Square root: Difference between revisions

From The K Language Wiki
Content added Content deleted
(add k7 and k9 forms)
("Better category ordering, add redirects to categories, fix pseudo-adverb categories")
 
(4 intermediate revisions by the same user not shown)
Line 21: Line 21:
(8.18535277187245;9.9498743710662 0n))
(8.18535277187245;9.9498743710662 0n))
</pre>
</pre>

[[Category:Verbs]]
[[Category:Operator verbs]]
[[Category:Primitives]]

Latest revision as of 06:42, 9 July 2022

Square root
%x
sqrt x

The square root function, generally denoted by %, gets the floating point square root of a given number.

It is also present in K7 and K9 as sqrt.

The result of square root is undefined for negative numbers, and returns 0n.

The square root primitive is right atomic.

 %4
2.0

 %5 7 9
2.23606797749979 2.6457513110645907 3.0

 %-20
0n

 %(22 45;(67;(99;-1)))
(4.69041575982343 6.708203932499369
 (8.18535277187245;9.9498743710662 0n))