From 36e29e04f83e22b1b69b27b3a61b2aeef5c6b24a Mon Sep 17 00:00:00 2001 From: James Hagerty Date: Thu, 20 Oct 2022 10:03:14 +0000 Subject: [PATCH] Added an example for the HH\Lib\Math\sqrt function --- api-examples/function.HH.Lib.Math.sqrt.md | 10 ++++++++++ .../function.HH.Lib.Math.sqrt/basic-usage.hack | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 api-examples/function.HH.Lib.Math.sqrt.md create mode 100644 build/extracted-examples/api/hsl/function.HH.Lib.Math.sqrt/basic-usage.hack diff --git a/api-examples/function.HH.Lib.Math.sqrt.md b/api-examples/function.HH.Lib.Math.sqrt.md new file mode 100644 index 000000000..5ef3d038c --- /dev/null +++ b/api-examples/function.HH.Lib.Math.sqrt.md @@ -0,0 +1,10 @@ +```basic-usage.hack +$sqrt1 = Math\sqrt(4); +printf("%.2f\n, sqrt1); + +$sqrt2 = Math\sqrt(7); +printf("%.2f\n, sqrt2); + +$sqrt3 = Math\sqrt(11.1); +printf("%.2f\n, sqrt3); +``` \ No newline at end of file diff --git a/build/extracted-examples/api/hsl/function.HH.Lib.Math.sqrt/basic-usage.hack b/build/extracted-examples/api/hsl/function.HH.Lib.Math.sqrt/basic-usage.hack new file mode 100644 index 000000000..473179834 --- /dev/null +++ b/build/extracted-examples/api/hsl/function.HH.Lib.Math.sqrt/basic-usage.hack @@ -0,0 +1,18 @@ +// WARNING: Contains some auto-generated boilerplate code, see: +// HHVM\UserDocumentation\MarkdownExt\ExtractedCodeBlocks\FilterBase::addBoilerplate + +namespace HHVM\UserDocumentation\Api\Hsl\FunctionHHLibMathSqrt\BasicUsage; + +<<__EntryPoint>> +async function _main(): Awaitable { + \init_docs_autoloader(); + + $sqrt1 = Math\sqrt(4); + printf("%.2f\n, sqrt1); + + $sqrt2 = Math\sqrt(7); + printf("%.2f\n, sqrt2); + + $sqrt3 = Math\sqrt(11.1); + printf("%.2f\n, sqrt3); +}