-
Notifications
You must be signed in to change notification settings - Fork 0
module std.math
Jan Špaček edited this page Apr 12, 2016
·
1 revision
Spiral provides the basic numeric functions. All float operations work with full 64-bit precision.
-
Utility functions
-
(neg a)
returns negated numbera
(useful, because Spiral has no syntax for negative literals). -
(square a)
returnsa
multiplied with itself.
-
-
Rounding to nearest integer
-
(floor a)
and(ceil a)
round the numbera
to the nearest integer in the appropriate direction. However, doubles will not be converted into integers. -
(floor-int a)
and(ceiling-int a)
, on the other hand, always return an integer.
-
-
Numberic functions
-
(abs a)
returns the absolute value. -
(exp a)
computes the exponential. -
(log a)
computes the natural logarithm. -
(sin a)
,(cos a)
and(tan a)
are the trigonometric functions. -
(acos a)
,(acos a)
,(atan a)
and(atan-2 a b)
are the standard inverse trigonometric functions.
-