Skip to main content

Mathematical functions

abs()

Calculates the absolute value of the input.

Arguments

Returns

  • Absolute value of x.

Examples

Run in Playground

acos()

Returns the angle whose cosine is the specified number (the inverse operation of cos()) .

Arguments

Returns

  • The value of the arc cosine of x
  • null if x < -1 or x > 1

Examples

Run in Playground

asin()

Returns the angle whose sine is the specified number (the inverse operation of sin()) .

Arguments

  • x: A real number in range [-1, 1].

Returns

  • The value of the arc sine of x
  • null if x < -1 or x > 1

Examples

Run in Playground

atan()

Returns the angle whose tangent is the specified number (the inverse operation of tan()) .

Arguments

x: A real number.

Returns

The value of the arc tangent of x

Examples

Run in Playground

atan2()

Calculates the angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x).

Arguments

x: X coordinate (a real number). y: Y coordinate (a real number).

Returns

The angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x).

Examples

Run in Playground

cos()

Returns the cosine function.

Arguments

x: A real number.

Returns

The result of cos(x)

Examples

Run in Playground

degrees()

Converts angle value in radians into value in degrees, using formula degrees = (180 / PI ) * angle_in_radians

Arguments

Returns

The corresponding angle in degrees for an angle specified in radians.

Examples

Run in Playground

exp()

The base-e exponential function of x, which is e raised to the power x: e^x.

Arguments

Returns

  • Exponential value of x.
  • For natural (base-e) logarithms, see log().
  • For exponential functions of base-2 and base-10 logarithms, see exp2(), exp10()

Examples

Run in Playground

exp2()

The base-2 exponential function of x, which is 2 raised to the power x: 2^x.

Arguments

Returns

  • Exponential value of x.
  • For natural (base-2) logarithms, see log2().
  • For exponential functions of base-e and base-10 logarithms, see exp(), exp10()

Examples

Run in Playground

gamma()

Computes gamma function

Arguments

  • x: Parameter for the gamma function

Returns

  • Gamma function of x.
  • For computing log-gamma function, see loggamma().

Examples

Run in Playground

isinf()

Returns whether input is an infinite (positive or negative) value.

Example

Run in Playground

Arguments

x: A real number.

Returns

A non-zero value (true) if x is a positive or negative infinite; and zero (false) otherwise.

isnan()

Returns whether input is Not-a-Number (NaN) value.

Arguments

x: A real number.

Returns

A non-zero value (true) if x is NaN; and zero (false) otherwise.

Examples

Run in Playground

log()

log() returns the natural logarithm function.

Arguments

Returns

The natural logarithm is the base-e logarithm: the inverse of the natural exponential function (exp). null if the argument is negative or null or can’t be converted to a real value.

Examples

Run in Playground

log10()

log10() returns the common (base-10) logarithm function.

Arguments

Returns

The common logarithm is the base-10 logarithm: the inverse of the exponential function (exp) with base 10. null if the argument is negative or null or can’t be converted to a real value.

Examples

Run in Playground

log2()

log2() returns the base-2 logarithm function.

Arguments

Returns

The logarithm is the base-2 logarithm: the inverse of the exponential function (exp) with base 2. null if the argument is negative or null or can’t be converted to a real value.

Examples

Run in Playground

loggamma()

Computes log of absolute value of the gamma function

Arguments

x: Parameter for the gamma function

Returns

  • Returns the natural logarithm of the absolute value of the gamma function of x.

Examples

Run in Playground

not()

Reverses the value of its bool argument.

Examples

Run in Playground

Arguments

Returns

Returns the reversed logical value of its bool argument.

pi()

Returns the constant value of Pi.

Returns

  • The double value of Pi (3.1415926…)

Examples

Run in Playground

pow()

Returns a result of raising to power

Examples

Run in Playground

Arguments

  • base: Base value.
  • exponent: Exponent value.

Returns

Returns base raised to the power exponent: base ^ exponent.

radians()

Converts angle value in degrees into value in radians, using formula radians = (PI / 180 ) * angle_in_degrees

Arguments

Returns

The corresponding angle in radians for an angle specified in degrees.

Examples

Run in Playground

round()

Returns the rounded source to the specified precision.

Arguments

  • source: The source scalar the round is calculated on.
  • Precision: Number of digits the source will be rounded to.(default value is 0)

Returns

The rounded source to the specified precision.

Examples

Run in Playground

sign()

Sign of a numeric expression

Examples

Run in Playground

Arguments

  • x: A real number.

Returns

  • The positive (+1), zero (0), or negative (-1) sign of the specified expression.

sin()

Returns the sine function.

Examples

Run in Playground

Arguments

Returns

The result of sin(x)

sqrt()

Returns the square root function.

Examples

Run in Playground

Arguments

Returns

  • A positive number such that _sqrt(x) _ sqrt(x) == x*
  • null if the argument is negative or cannot be converted to a real value.

tan()

Returns the tangent function.

Examples

Run in Playground

Argument

Returns

  • The result of tan(x)

exp10()

The base-10 exponential function of x, which is 10 raised to the power x: 10^x.

Examples

Run in Playground

Arguments

Returns

  • Exponential value of x.
  • For natural (base-10) logarithms, see log10().
  • For exponential functions of base-e and base-2 logarithms, see exp(), exp2()

isint()

Returns whether input is an integer (positive or negative) value.

Arguments

  • Expr: expression value which can be a real number

Returns

A non-zero value (true) if expression is a positive or negative integer; and zero (false) otherwise.

Examples

Run in Playground

isfinite()

Returns whether input is a finite value (is neither infinite nor NaN).

Arguments

  • number: A real number.

Returns

A non-zero value (true) if x is finite; and zero (false) otherwise.

Examples

Run in Playground