Adds two numbers.
| Type | Value |
| Input | Num | the first summand |
| b (param #1) | Num | the second summand |
| Output | Num | the sum |
| Program | Type | Value | Error |
1 +1 | Num | 2 | |
1 +2 *3 | Num | 9 | |
1 +(2 *3) | Num | 7 | |
Subtracts a number from another.
| Type | Value |
| Input | Num | the minuend |
| b (param #1) | Num | the subtrahend |
| Output | Num | the difference |
| Program | Type | Value | Error |
5 -3 | Num | 2 | |
Returns the additive inverse of a number.
| Type | Value |
| Input | Any | any value (is ignored) |
| n (param #1) | Num | a number |
| Output | Num | the additive inverse (opposite number) of n |
| Program | Type | Value | Error |
-1 | Num | -1 | |
-(-2.0) | Num | 2 | |
-inf | Num | -inf | |
-nan | Num | nan | |
Multiplies two numbers.
| Type | Value |
| Input | Num | the first factor |
| b (param #1) | Num | the second factor |
| Output | Num | the product |
| Program | Type | Value | Error |
2 *3 | Num | 6 | |
Divides a number by another.
| Type | Value |
| Input | Num | the dividend |
| b (param #1) | Num | the divisor |
| Output | Num | the quotient |
| Program | Type | Value | Error |
3 /2 | Num | 1.5 | |
1 /0 | Num | inf | |
Remainder
| Type | Value |
| Input | Num | the dividend |
| b (param #1) | Num | the divisor |
| Output | Num | the remainder of integer division (rounded towards zero) |
| Program | Type | Value | Error |
3 %2 | Num | 1 | |
-8.5 %3 | Num | -2.5 | |
Less than
| Type | Value |
| Input | Num | a number |
| b (param #1) | Num | another number |
| Output | Bool | true iff the input is smaller than b |
| Program | Type | Value | Error |
2 <1 | Bool | false | |
-inf <inf | Bool | true | |
0 <0 | Bool | false | |
Greater than
| Type | Value |
| Input | Num | a number |
| b (param #1) | Num | another number |
| Output | Bool | true iff the input is greater than b |
| Program | Type | Value | Error |
2 >1 | Bool | true | |
-inf >inf | Bool | false | |
0 >0 | Bool | false | |
Less than or equal to
| Type | Value |
| Input | Num | a number |
| b (param #1) | Num | another number |
| Output | Bool | true iff the input is less than or equal to b |
| Program | Type | Value | Error |
2 <=1 | Bool | false | |
-inf <=inf | Bool | true | |
0 <=0 | Bool | true | |
Greater than or equal to
| Type | Value |
| Input | Num | a number |
| b (param #1) | Num | another number |
| Output | Bool | true iff the input is greater than or equal to b |
| Program | Type | Value | Error |
2 >=1 | Bool | true | |
-inf >=inf | Bool | false | |
0 >=0 | Bool | true | |
Computes the sum of several numbers.
| Type | Value |
| Input | Arr<Num...> | an array of numbers |
| Output | Num | their sum |
| Program | Type | Value | Error |
[1, 2, 3, 4] sum | Num | 10 | |
[] sum | Num | 0 | |
Computes the median of several numbers.
| Type | Value |
| Input | Arr<Num...> | an array of numbers |
| Output | Num | their median |
| Program | Type | Value | Error |
[2, 3, 7] median | Num | 3 | |
[2, 3, 5, 7] median | Num | 4 | |
[1.25] median | Num | 1.25 | |
[] median | Num | nan | |
Computes the arithmetic mean (average) of several numbers.
| Type | Value |
| Input | Arr<Num...> | an array of numbers |
| Output | Num | their mean |
| Program | Type | Value | Error |
[2, 3, 5, 7] mean | Num | 4.25 | |
[1.25] mean | Num | 1.25 | |
[] mean | Num | nan | |
Returns infinity.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the special number value representing positive infinity |
| Program | Type | Value | Error |
inf | Num | inf | |
-inf | Num | -inf | |
inf +inf | Num | inf | |
inf -inf | Num | nan | |
Returns NaN.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the special number value representing “not a number” |
| Program | Type | Value | Error |
nan | Num | nan | |
nan ==2 | Bool | false | |
nan ==nan | Bool | false | |
-nan | Num | nan | |
Checks whether a number is finite.
| Type | Value |
| Input | Num | a number |
| Output | Bool | true unless the input is positive or negative infinity |
| Program | Type | Value | Error |
1024 isFinite | Bool | true | |
-1024 isFinite | Bool | true | |
inf isFinite | Bool | false | |
-inf isFinite | Bool | false | |
nan isFinite | Bool | true | |
Checks whether a number is NaN.
| Type | Value |
| Input | Num | a number |
| Output | Bool | true iff the input is NaN |
| Program | Type | Value | Error |
1024 isNaN | Bool | false | |
nan isNaN | Bool | true | |
Returns the floating point epsilon.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the difference between 1 and the smallest floating point number greater than 1 |
| Program | Type | Value | Error |
epsilon | Num | 2.220446049250313e-16 | |
Returns the largest safe integer.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the largest integer that can be represented as an IEEE-754 double precision number and cannot be the result of rounding another number to fit IEEE-754 |
| Program | Type | Value | Error |
largestSafeInteger +0 | Num | 9007199254740991 | |
largestSafeInteger +1 | Num | 9007199254740992 | |
largestSafeInteger +2 | Num | 9007199254740992 | |
Returns the largest representable number.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the largest number representable as an IEEE-754 double precision number |
| Program | Type | Value | Error |
largestNum | Num | 1.7976931348623157e+308 | |
largestNum +largestNum | Num | inf | |
Returns the smallest safe integer.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the smallest integer that can be represented as an IEEE-754 double precision number and cannot be the result of rounding another integer to fit the IEEE-754 double precision representation |
| Program | Type | Value | Error |
smallestSafeInteger -0 | Num | -9007199254740991 | |
smallestSafeInteger -1 | Num | -9007199254740992 | |
smallestSafeInteger -2 | Num | -9007199254740992 | |
Returns the smallest representable positive number.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the smallest representable positive number |
| Program | Type | Value | Error |
smallestPositiveNum | Num | 5e-324 | |
Checks whether a number is integer.
| Type | Value |
| Input | Num | a number |
| Output | Bool | true iff the input represents a whole number |
| Program | Type | Value | Error |
1.0 isInteger | Bool | true | |
1.1 isInteger | Bool | false | |
Checks whether a number is a safe integer.
| Type | Value |
| Input | Num | a number |
| Output | Bool | true iff the input is an integer and cannot be the result of rounding another integer to fit the IEEE-754 double precision representation |
| Program | Type | Value | Error |
-9007199254740992 isSafeInteger | Bool | false | |
-9007199254740991 isSafeInteger | Bool | true | |
0 isSafeInteger | Bool | true | |
0.1 isSafeInteger | Bool | false | |
9007199254740991 isSafeInteger | Bool | true | |
9007199254740992 isSafeInteger | Bool | false | |
Converts an integer to a specified base.
| Type | Value |
| Input | Num | an integer |
| base (param #1) | Num | an integer between 2 and 36 (inclusive) |
| Output | Str | a string representation of the input in the specified base |
| Program | Type | Value | Error |
233 toBase(16) | Str | "e9" | |
11 toBase(16) | Str | "b" | |
Converts a number to exponential notation.
| Type | Value |
| Input | Num | a number |
| Output | Str | a string representation of the input in exponential notation with 6 digits after the decimal point |
| Program | Type | Value | Error |
77.1234 toExponential | Str | "7.712340e+01" | |
77 toExponential | Str | "7.700000e+01" | |
Converts a number to exponential notation.
| Type | Value |
| Input | Num | a number |
| precision (param #1) | Num | the number of digits after the decimal point |
| Output | Str | a string representation of the input in exponential notation with the specified number of digits after the decimal point |
| Program | Type | Value | Error |
77.1234 toExponential(4) | Str | "7.7123e+01" | |
77.1234 toExponential(2) | Str | "7.71e+01" | |
Converts a number to fixed-point notation.
| Type | Value |
| Input | Num | a number |
| precision (param #1) | Num | the number of digits after the decimal point |
| Output | Str | a rounded string representation of the input with the specified number of digits after the decimal point |
| Program | Type | Value | Error |
123.456 toFixed(2) | Str | "123.46" | |
0.004 toFixed(2) | Str | "0.00" | |
1.23e+5 toFixed(2) | Str | "123000.00" | |
Returns Euler's number.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | an approximation of Euler's number |
| Program | Type | Value | Error |
e | Num | 2.718281828459045 | |
Returns the natural logarithm of 2.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the approximate natural logarithm of 2 |
| Program | Type | Value | Error |
ln2 | Num | 0.6931471805599453 | |
Returns the natural logarithm of 10.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the approximate natural logarithm of 10 |
| Program | Type | Value | Error |
ln10 | Num | 2.302585092994046 | |
Returns the base-2 logarithm of e
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the approximate base-2 logarithm of Euler's number |
| Program | Type | Value | Error |
log2e | Num | 1.4426950408889634 | |
Returns the base-10 logarithm of e
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the approximate base-10 logarithm of Euler's number |
| Program | Type | Value | Error |
log10e | Num | 0.4342944819032518 | |
Returns pi.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | an approximation of pi |
| Program | Type | Value | Error |
pi | Num | 3.141592653589793 | |
for Num def radiusToCircumference Num as *2 *pi ok 10 radiusToCircumference | Num | 62.83185307179586 | |
Returns the square root of 1/2.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the approximate square root of 1/2 |
| Program | Type | Value | Error |
sqrt1_2 | Num | 0.7071067811865476 | |
Returns the square root of 2.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | the approximate square root of 2 |
| Program | Type | Value | Error |
sqrt2 | Num | 1.4142135623730951 | |
Computes the absolute value.
| Type | Value |
| Input | Num | a number |
| Output | Num | the absolute value of the input |
| Program | Type | Value | Error |
3 -5 abs | Num | 2 | |
5 -3 abs | Num | 2 | |
1.23456 -7.89012 abs | Num | 6.6555599999999995 | |
Computes the inverse cosine.
| Type | Value |
| Input | Num | a number in the interval [-1, 1] |
| Output | Num | the inverse cosine (in radians) of the input, or nan if the input is invalid |
| Program | Type | Value | Error |
-2 acos | Num | nan | |
-1 acos | Num | 3.141592653589793 | |
0 acos | Num | 1.5707963267948966 | |
1 acos | Num | 0 | |
1.1 acos | Num | nan | |
Computes the inverse hyperbolic cosine.
| Type | Value |
| Input | Num | a number greater than or equal to 1 |
| Output | Num | the inverse hyperoblic cosine of the input, or nan if the input is invalid |
| Program | Type | Value | Error |
0.9 acosh | Num | nan | |
1 acosh | Num | 0 | |
10 acosh | Num | 2.993222846126381 | |
Computes the inverse sine.
| Type | Value |
| Input | Num | a number in the interval [-1, 1] |
| Output | Num | the inverse sine (in radians) of the input, of nan if the input is invalid |
| Program | Type | Value | Error |
-2 asin | Num | nan | |
-1 asin | Num | -1.5707963267948966 | |
0 asin | Num | 0 | |
1 asin | Num | 1.5707963267948966 | |
1.1 asin | Num | nan | |
Computes the inverse hyperbolic sine.
| Type | Value |
| Input | Num | a number |
| Output | Num | the inverse hyperbolic sine of the input |
| Program | Type | Value | Error |
-1 asinh | Num | -0.881373587019543 | |
0 asinh | Num | 0 | |
1 asinh | Num | 0.881373587019543 | |
2 asinh | Num | 1.4436354751788103 | |
Computes the inverse tangent.
| Type | Value |
| Input | Num | a number |
| Output | Num | the inverse tangent (in radians) of the input |
| Program | Type | Value | Error |
-10 atan | Num | -1.4711276743037345 | |
-1 atan | Num | -0.7853981633974483 | |
0 atan | Num | 0 | |
1 atan | Num | 0.7853981633974483 | |
Computes the angle in the plane.
| Type | Value |
| Input | Num | a number y (y-coordinate) |
| x (param #1) | Num | a number (x-coordinate) |
| Output | Num | the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to (x, y) |
| Program | Type | Value | Error |
5 atan2(5) | Num | 0.7853981633974483 | |
10 atan2(10) | Num | 0.7853981633974483 | |
10 atan2(0) | Num | 1.5707963267948966 | |
Computes the inverse hyperbolic tangent.
| Type | Value |
| Input | Num | a number in the interval [-1, 1] |
| Output | Num | the inverse hyperbolic tangent of the input, or nan if the input is invalid |
| Program | Type | Value | Error |
-2 atanh | Num | nan | |
-1 atanh | Num | -inf | |
0 atanh | Num | 0 | |
0.5 atanh | Num | 0.5493061443340548 | |
1 atanh | Num | inf | |
Computes the cube root.
| Type | Value |
| Input | Num | a number |
| Output | Num | the cube root of the input |
| Program | Type | Value | Error |
-1 cbrt | Num | -1 | |
1 cbrt | Num | 1 | |
inf cbrt | Num | inf | |
64 cbrt | Num | 4 | |
Rounds a number up.
| Type | Value |
| Input | Num | a number |
| Output | Num | the smallest integer greater than or equal to the input |
| Program | Type | Value | Error |
.95 ceil | Num | 1 | |
4 ceil | Num | 4 | |
7.004 ceil | Num | 8 | |
-7.004 ceil | Num | -7 | |
Count leading zeros.
| Type | Value |
| Input | Num | a number (is truncated to integer) |
| Output | Num | the number of leading zero bits in the 32-bit binary representation of the input |
| Program | Type | Value | Error |
-inf clz32 | Num | 32 | |
-4 clz32 | Num | 0 | |
-1 clz32 | Num | 0 | |
0 clz32 | Num | 32 | |
0.5 clz32 | Num | 32 | |
1 clz32 | Num | 31 | |
1.1 clz32 | Num | 31 | |
4 clz32 | Num | 29 | |
4.7 clz32 | Num | 29 | |
1000 clz32 | Num | 22 | |
inf clz32 | Num | 32 | |
Computes the cosine.
| Type | Value |
| Input | Num | an angle in radians |
| Output | Num | the cosine of the input |
| Program | Type | Value | Error |
-inf cos | Num | nan | |
-0 cos | Num | 1 | |
0 cos | Num | 1 | |
1 cos | Num | 0.5403023058681398 | |
pi cos | Num | -1 | |
pi *2 cos | Num | 1 | |
inf cos | Num | nan | |
Computes the hyperbolic cosine.
| Type | Value |
| Input | Num | a number |
| Output | Num | the hyperbolic cosine of the input |
| Program | Type | Value | Error |
0 cosh | Num | 1 | |
1 cosh | Num | 1.5430806348152437 | |
-1 cosh | Num | 1.5430806348152437 | |
2 cosh | Num | 3.7621956910836314 | |
Computes the exponential function.
| Type | Value |
| Input | Num | the exponent |
| Output | Num | e (Euler's number) raised to the exponent |
| Program | Type | Value | Error |
-inf exp | Num | 0 | |
-1 exp | Num | 0.36787944117144233 | |
0 exp | Num | 1 | |
1 exp | Num | 2.718281828459045 | |
inf exp | Num | inf | |
Computes the exponential function, subtracted by one.
| Type | Value |
| Input | Num | the exponent |
| Output | Num | |
e (Euler's number) raised to the exponent, minus 1
| Program | Type | Value | Error |
-inf expm1 | Num | -1 | |
-1 expm1 | Num | -0.6321205588285577 | |
-0 expm1 | Num | -0 | |
0 expm1 | Num | 0 | |
1 expm1 | Num | 1.718281828459045 | |
inf expm1 | Num | inf | |
Rounds down.
| Type | Value |
| Input | Num | a number |
| Output | Num | the largest integer less than or equal to the input |
| Program | Type | Value | Error |
5.95 floor | Num | 5 | |
5.05 floor | Num | 5 | |
5 floor | Num | 5 | |
-5.05 floor | Num | -6 | |
Rounds to 32-bit precision.
| Type | Value |
| Input | Num | a number |
| Output | Num | the nearest 32-bit single precision float representation |
| Program | Type | Value | Error |
5.5 fround | Num | 5.5 | |
5.05 fround | Num | 5.050000190734863 | |
5 fround | Num | 5 | |
-5.05 fround | Num | -5.050000190734863 | |
Computes the square root of the sum of squares
| Type | Value |
| Input | Arr<Num...> | an array of numbers |
| Output | Num | the square root of the sum of the squares of the input numbers |
| Program | Type | Value | Error |
[3, 4] hypot | Num | 5 | |
[5, 12] hypot | Num | 13 | |
[3, 4, 5] hypot | Num | 7.0710678118654755 | |
[-5] hypot | Num | 5 | |
32-bit multiplication
| Type | Value |
| Input | Num | the first factor |
| y (param #1) | Num | the second factor |
| Output | Num | the product of the 32-bit versions (cf. fround) of the factors |
| Program | Type | Value | Error |
3 imul(4) | Num | 12 | |
-5 imul(12) | Num | -60 | |
"ffffffff" parseInt(16) imul(5) | Num | -5 | |
"fffffffe" parseInt(16) imul(5) | Num | -10 | |
Computes the natural logarithm.
| Type | Value |
| Input | Num | a number |
| Output | Num | the natural (base e) logarithm of the input |
| Program | Type | Value | Error |
-1 log | Num | nan | |
-0 log | Num | -inf | |
0 log | Num | -inf | |
1 log | Num | 0 | |
10 log | Num | 2.302585092994046 | |
inf log | Num | inf | |
8 log /(2 log) | Num | 3 | |
625 log /(5 log) | Num | 4 | |
Computes the base 10 logarithm.
| Type | Value |
| Input | Num | a number |
| Output | Num | the base 10 logarithm of the input |
| Program | Type | Value | Error |
-2 log10 | Num | nan | |
-0 log10 | Num | -inf | |
0 log10 | Num | -inf | |
1 log10 | Num | 0 | |
2 log10 | Num | 0.3010299956639812 | |
100000 log10 | Num | 5 | |
inf log10 | Num | inf | |
Computes the natural logarithm of x + 1.
| Type | Value |
| Input | Num | a number (x) |
| Output | Num | |
the natural (base e) logarithm of (x + 1)
| Program | Type | Value | Error |
1 log1p | Num | 0.6931471805599453 | |
0 log1p | Num | 0 | |
-1 log1p | Num | -inf | |
-2 log1p | Num | nan | |
Computes the base 2 logarithm.
| Type | Value |
| Input | Num | a number |
| Output | Num | the base 2 logarithm of the input |
| Program | Type | Value | Error |
3 log2 | Num | 1.5849625007211563 | |
2 log2 | Num | 1 | |
1 log2 | Num | 0 | |
0 log2 | Num | -inf | |
Finds the largest number
| Type | Value |
| Input | Arr<Num...> | an array of numbers |
| Output | Num | the largest number in the input, or -inf if the input is empty |
| Program | Type | Value | Error |
[1, 3, 2] max | Num | 3 | |
[-1, -3, -2] max | Num | -1 | |
[] max | Num | -inf | |
Finds the smallest number
| Type | Value |
| Input | Arr<Num...> | an array of numbers |
| Output | Num | the smallest number in the input, or inf if the input is empty |
| Program | Type | Value | Error |
[1, 3, 2] min | Num | 1 | |
[-1, -3, -2] min | Num | -3 | |
[] min | Num | inf | |
Computes powers (exponentiation).
| Type | Value |
| Input | Num | the base |
| y (param #1) | Num | the exponent |
| Output | Num | the base taken to the y-th power |
| Program | Type | Value | Error |
7 **3 | Num | 343 | |
4 **.5 | Num | 2 | |
7 **(-2) | Num | 0.02040816326530612 | |
-7 **0.5 | Num | nan | |
Returns a random number between 0 and 1.
| Type | Value |
| Input | Any | any value (is ignored) |
| Output | Num | a floating-point, pseudo-random number n with 0 <= n < 1 and approximately uniform distribution over that range |
| Program | Type | Value | Error |
[null] repeat(1000) each(random) each(>=0) all | Bool | true | |
[null] repeat(1000) each(random) each(<1) all | Bool | true | |
Returns a random integer number in a specified interval.
| Type | Value |
| Input | Any | any value (is ignored) |
| from (param #1) | Num | lower bound (inclusive); rounded towards 0 if not integer |
| to (param #2) | Num | upper bound (exclusive); rounded towards 0 if not integer |
| Output | Num | a integer, pseudorandom number n with from <= n < to and approximately uniform distribution over that range |
| Program | Type | Value | Error |
[null] repeat(1000) each(random(2, 7)) each(>=2) all | Bool | true | |
[null] repeat(1000) each(random(2, 7)) each(<7) all | Bool | true | |
[null] repeat(1000) each(random(2, 7)) each(=n floor ==n) all | Bool | true | |
[null] repeat(1000) each(random(2.4, 7.6)) each(>=2) all | Bool | true | |
[null] repeat(1000) each(random(2.4, 7.6)) each(<7) all | Bool | true | |
[null] repeat(1000) each(random(2.4, 7.6)) each(=n floor ==n) all | Bool | true | |
[null] repeat(1000) each(random(-7, -2)) each(>=(-7)) all | Bool | true | |
[null] repeat(1000) each(random(-7, -2)) each(<(-2)) all | Bool | true | |
[null] repeat(1000) each(random(-7, -2)) each(=n floor ==n) all | Bool | true | |
[null] repeat(1000) each(random(-7.6, -2.4)) each(>=(-7)) all | Bool | true | |
[null] repeat(1000) each(random(-7.6, -2.4)) each(<(-2)) all | Bool | true | |
[null] repeat(1000) each(random(-7.6, -2.4)) each(=n floor ==n) all | Bool | true | |
random(7, 2) | Bool | | Value error Code: UnexpectedValue Message: Component got an unexpected input value.
|
random(2, 2) | Bool | | Value error Code: UnexpectedValue Message: Component got an unexpected input value.
|
Rounds a number to the nearest integer.
| Type | Value |
| Input | Num | a number |
| Output | Num | the nearest integer, or away from zero if there's two nearest integers |
| Program | Type | Value | Error |
0.9 round | Num | 1 | |
5.95 round | Num | 6 | |
5.5 round | Num | 6 | |
5.05 round | Num | 5 | |
-5.05 round | Num | -5 | |
-5.5 round | Num | -6 | |
-5.95 round | Num | -6 | |
Determines the sign of a number.
| Type | Value |
| Input | Num | a number |
| Output | Num | 1 if the input is positive, -1 if negative, 0 if it's 0, and -0 if it's -0 |
| Program | Type | Value | Error |
3 sign | Num | 1 | |
0 sign | Num | 0 | |
-0 sign | Num | -0 | |
-3 | Num | -3 | |
Computes the sine.
| Type | Value |
| Input | Num | an angle in radians |
| Output | Num | the sine of the input |
| Program | Type | Value | Error |
-inf sin | Num | nan | |
-0 sin | Num | -0 | |
0 sin | Num | 0 | |
1 sin | Num | 0.8414709848078965 | |
pi /2 sin | Num | 1 | |
inf sin | Num | nan | |
Computes the hyperbolic sine.
| Type | Value |
| Input | Num | a number |
| Output | Num | the hyperbolic sine of the input |
| Program | Type | Value | Error |
0 sinh | Num | 0 | |
1 sinh | Num | 1.1752011936438014 | |
-1 sinh | Num | -1.1752011936438014 | |
2 sinh | Num | 3.626860407847019 | |
Computes square roots.
| Type | Value |
| Input | Num | a number |
| Output | Num | the square root of the input, or nan if it's negative |
| Program | Type | Value | Error |
-1 sqrt | Num | nan | |
-0 sqrt | Num | -0 | |
0 sqrt | Num | 0 | |
1 sqrt | Num | 1 | |
2 sqrt | Num | 1.4142135623730951 | |
9 sqrt | Num | 3 | |
inf sqrt | Num | inf | |
Computes the tangent.
| Type | Value |
| Input | Num | an angle in radians |
| Output | Num | the tangent of the input |
| Program | Type | Value | Error |
0 *pi /180 tan | Num | 0 | |
45 *pi /180 tan | Num | 1 | |
90 *pi /180 tan | Num | 16331239353195392 | |
Computes the hyperbolic tangent.
| Type | Value |
| Input | Num | a number |
| Output | Num | the hyperbolic tangent of the input |
| Program | Type | Value | Error |
-1 tanh | Num | -0.7615941559557649 | |
0 tanh | Num | 0 | |
inf tanh | Num | 1 | |
1 tanh | Num | 0.7615941559557649 | |
Rounds towards zero.
| Type | Value |
| Input | Num | a number |
| Output | Num | the input without fractional digits |
| Program | Type | Value | Error |
13.37 trunc | Num | 13 | |
42.84 trunc | Num | 42 | |
0.123 trunc | Num | 0 | |
-0.123 trunc | Num | -0 | |