Math Functions: Difference between revisions

From The K Language Wiki
Content added Content deleted
(add oK math primitives)
 
("Better category ordering, add redirects to categories, fix pseudo-adverb categories")
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:


all primitives are [[atomicity|right atomic]] if [[monadic]], [[atomicity|fully atomic]] if [[dyadic]].
all primitives are [[atomicity|right atomic]] if [[monadic]], [[atomicity|fully atomic]] if [[dyadic]].
== abs ==

Gets the absolute value of any number.
<pre>
abs -1 1
1 1
</pre>
== sin ==
== sin ==
Computes the sine of a value given in radians.
Computes the sine of a value given in radians.
Line 25: Line 30:
1024 15625f
1024 15625f
</pre>
</pre>

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

Latest revision as of 06:41, 9 July 2022

This page documents all math primitives included in K releases.

all primitives are right atomic if monadic, fully atomic if dyadic.

abs[edit]

Gets the absolute value of any number.

 abs -1 1
1 1

sin[edit]

Computes the sine of a value given in radians.

 sin 12 25 360 24
-0.5365729 -0.1323518 0.9589157 -0.9055784

cos[edit]

Computes the cosine of a value given in radians.

 cos 12 25 360 24
0.843854 0.9912028 -0.2836911 0.424179

exp[edit]

In monadic form, uses e as the base.

 exp 5
148.4132
 4 5 exp 5 6 
1024 15625f