squareroot: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page squareroot to Squareroot without leaving a redirect: Converting page title to first-letter uppercase)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: num = squareroot(number)]
[h: num = squareroot(number)]
[h: num = sqrt(number, precision)]
[h: num = sqrt(number, precision)]
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|number|Value to determine the square root of.}}
{{param|number|Value to determine the square root of.}}
Line 14: Line 14:


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: squareroot(9)]
[r: squareroot(9)]
[r: squareroot(80)]
[r: squareroot(80)]
[r: sqrt(10,2)]
[r: sqrt(10,2)]
</source>
</syntaxhighlight>
'''Returns'''  
'''Returns'''  
<source lang="mtmacro">
<syntaxhighlight lang="mtmacro">
   3   
   3   
   8.9442719100   
   8.9442719100   
   3.16   
   3.16   
</source>
</syntaxhighlight>


}}
}}
[[Category:Mathematical Function]]
[[Category:Mathematical Function]]

Latest revision as of 17:42, 14 March 2023

squareroot() Function

Returns the square root of a number.

Usage

[h: num = squareroot(number)]
[h: num = sqrt(number, precision)]

Parameters

  • number - Value to determine the square root of.
  • precision - Number of decimal points. Defaults to 10.

Example

[r: squareroot(9)]
[r: squareroot(80)]
[r: sqrt(10,2)]

Returns

  3  
  8.9442719100  
  3.16