From WikiChip
Difference between revisions of "mirc/identifiers/$sqrt"
Maroonbells (talk | contribs) (Create content for empty page) |
(Undo revision 83489 by 172.56.35.210 (talk)) |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | {{mirc title|$sqrt | + | {{mirc title|$sqrt identifier}}'''$sqrt''' returns the square root. |
− | + | ||
== Synopsis == | == Synopsis == | ||
− | < | + | <source lang="mIRC">$sqrt(<N>)</source> |
== Parameters == | == Parameters == | ||
− | + | * '''N''' - Number for which the square root is returned | |
+ | |||
+ | If N is negative, returns $null. You can use the letter 'e' or 'd' as *10^N, $sqrt(5e6) = $sqrt($calc(5*10^6)) | ||
− | |||
Square Root is limited to 6 decimal places. When squared, it often has a rounding error difference from the original N. | Square Root is limited to 6 decimal places. When squared, it often has a rounding error difference from the original N. | ||
== Example == | == Example == | ||
− | |||
<source lang="mIRC"> | <source lang="mIRC"> | ||
//echo -a $sqrt(3) is the same as $calc(3^.5) | //echo -a $sqrt(3) is the same as $calc(3^.5) | ||
Line 28: | Line 28: | ||
== See also == | == See also == | ||
* {{mIRC|$calc}} | * {{mIRC|$calc}} | ||
+ | {{mIRC identifier list}} | ||
− | [[Category: | + | [[Category:mIRC identifiers|sqrt]] |
Latest revision as of 18:49, 21 October 2018
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$sqrt returns the square root.
Synopsis[edit]
$sqrt(<N>)
Parameters[edit]
- N - Number for which the square root is returned
If N is negative, returns $null. You can use the letter 'e' or 'd' as *10^N, $sqrt(5e6) = $sqrt($calc(5*10^6))
Square Root is limited to 6 decimal places. When squared, it often has a rounding error difference from the original N.
Example[edit]
//echo -a $sqrt(3) is the same as $calc(3^.5) ; returns: 1.732051 is the same as 1.732051
//var %i 7 | echo -a $calc( $sqrt(%i) * $sqrt(%i) ) ; slight rounding error due to decimal limited to 6 places: 6.999998
Compatibility[edit]
Added: mIRC v5.3
Added on: 13 Dec 1997
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also[edit]
mIRC identifier list