Interface Math

interface Math {
    E: number;
    LN10: number;
    LN2: number;
    LOG10E: number;
    LOG2E: number;
    PI: number;
    SQRT1_2: number;
    SQRT2: number;
    [toStringTag]: string;
    abs(x): number;
    acos(x): number;
    acosh(x): number;
    asin(x): number;
    asinh(x): number;
    atan(x): number;
    atan2(y, x): number;
    atanh(x): number;
    cbrt(x): number;
    ceil(x): number;
    ceil_place(x, place): number;
    clamp(n, min, max): number;
    clamp_angle(angle): number;
    clamp_loop(num, max): number;
    clamp_zero_to_one(n): number;
    clz32(x): number;
    cos(x): number;
    cosh(x): number;
    exp(x): number;
    expm1(x): number;
    floor(x): number;
    floor_place(x, place): number;
    fround(x): number;
    gcd(a, b): number;
    hypot(...values): number;
    imul(x, y): number;
    log(x): number;
    log10(x): number;
    log1p(x): number;
    log2(x): number;
    max(...values): number;
    min(...values): number;
    pow(x, y): number;
    random(): number;
    round(x): number;
    round_place(x, place): number;
    sigmoid(x): number;
    sign(x): number;
    sin(x): number;
    sinh(x): number;
    sqrt(x): number;
    sum(array): number;
    tan(x): number;
    tanh(x): number;
    trunc(x): number;
}

Properties

E: number

The mathematical constant e. This is Euler's number, the base of natural logarithms.

LN10: number

The natural logarithm of 10.

LN2: number

The natural logarithm of 2.

LOG10E: number

The base-10 logarithm of e.

LOG2E: number

The base-2 logarithm of e.

PI: number

Pi. This is the ratio of the circumference of a circle to its diameter.

SQRT1_2: number

The square root of 0.5, or, equivalently, one divided by the square root of 2.

SQRT2: number

The square root of 2.

[toStringTag]: string

Methods

  • Returns the absolute value of a number (the value without regard to whether it is positive or negative). For example, the absolute value of -5 is the same as the absolute value of 5.

    Parameters

    • x: number

      A numeric expression for which the absolute value is needed.

    Returns number

  • Returns the arc cosine (or inverse cosine) of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the inverse hyperbolic cosine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns the arcsine of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the inverse hyperbolic sine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns the arctangent of a number.

    Parameters

    • x: number

      A numeric expression for which the arctangent is needed.

    Returns number

  • Returns the angle (in radians) from the X axis to a point.

    Parameters

    • y: number

      A numeric expression representing the cartesian y-coordinate.

    • x: number

      A numeric expression representing the cartesian x-coordinate.

    Returns number

  • Returns the inverse hyperbolic tangent of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns an implementation-dependent approximation to the cube root of number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the smallest integer greater than or equal to its numeric argument.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • 任意の桁で切り上げする関数

    Parameters

    • x: number

      切り上げする数値

    • place: number

      どの桁で切り上げするか ( 0 => 小数第 1 位、1 => 小数第 2 位、-1 => 1 の位 )

    Returns number

    切り上げした値

  • 渡した値を指定された値の間に正規化する ( 指定された値を含む )

    Parameters

    • n: number

      正規化する値

    • min: number

      最小値

    • max: number

      最大値

    Returns number

    指定された値の間に正規化された値

  • ラジアン角度 0 ~ PI*2 の範囲に収まるように正規化する

    Parameters

    • angle: number

      角度

    Returns number

    0 ~ PI*2 の範囲内に正規化された角度

  • 一定の範囲をとる値を 0 から最大値までの間で正規化する ( 超過した場合は最大値にするのではなく、最大値で割った余りを返す )

    Parameters

    • num: number

      正規化する値

    • max: number

      最大値

    Returns number

    0 ~ 最大値の間で正規化された値

  • 渡した値を 0 ~ 1 の間に正規化する ( 超過した場合はその値で止める )

    Parameters

    • n: number

      正規化する値

    Returns number

    0 ~ 1 の値

  • Returns the number of leading zero bits in the 32-bit binary representation of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the cosine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns the hyperbolic cosine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns e (the base of natural logarithms) raised to a power.

    Parameters

    • x: number

      A numeric expression representing the power of e.

    Returns number

  • Returns the result of (e^x - 1), which is an implementation-dependent approximation to subtracting 1 from the exponential function of x (e raised to the power of x, where e is the base of the natural logarithms).

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the greatest integer less than or equal to its numeric argument.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • 任意の桁で切り捨てする関数

    Parameters

    • x: number

      切り捨てする数値

    • place: number

      どの桁で切り捨てするか ( 0 => 小数第 1 位、1 => 小数第 2 位、-1 => 1 の位 )

    Returns number

    切り捨てした値

  • Returns the nearest single precision float representation of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • 最大公約数を求める

    Parameters

    • a: number

      値 1

    • b: number

      値 2

    Returns number

    最大公約数

  • Returns the square root of the sum of squares of its arguments.

    Parameters

    • Rest ...values: number[]

      Values to compute the square root for. If no arguments are passed, the result is +0. If there is only one argument, the result is the absolute value. If any argument is +Infinity or -Infinity, the result is +Infinity. If any argument is NaN, the result is NaN. If all arguments are either +0 or −0, the result is +0.

    Returns number

  • Returns the result of 32-bit multiplication of two numbers.

    Parameters

    • x: number

      First number

    • y: number

      Second number

    Returns number

  • Returns the natural logarithm (base e) of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the base 10 logarithm of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the natural logarithm of 1 + x.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the base 2 logarithm of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • Returns the larger of a set of supplied numeric expressions.

    Parameters

    • Rest ...values: number[]

      Numeric expressions to be evaluated.

    Returns number

  • Returns the smaller of a set of supplied numeric expressions.

    Parameters

    • Rest ...values: number[]

      Numeric expressions to be evaluated.

    Returns number

  • Returns the value of a base expression taken to a specified power.

    Parameters

    • x: number

      The base value of the expression.

    • y: number

      The exponent value of the expression.

    Returns number

  • Returns a pseudorandom number between 0 and 1.

    Returns number

  • Returns a supplied numeric expression rounded to the nearest integer.

    Parameters

    • x: number

      The value to be rounded to the nearest integer.

    Returns number

  • 任意の桁で四捨五入する関数

    Parameters

    • x: number

      四捨五入する数値

    • place: number

      どの桁で四捨五入するか ( 0 => 小数第 1 位、1 => 小数第 2 位、-1 => 1 の位 )

    Returns number

    四捨五入した値

  • シグモイド関数

    Parameters

    • x: number

      入力値

    Returns number

    シグモイド関数の出力値

  • Returns the sign of the x, indicating whether x is positive, negative or zero.

    Parameters

    • x: number

      The numeric expression to test

    Returns number

  • Returns the sine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns the hyperbolic sine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns the square root of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

  • 配列の総和を取得する

    Parameters

    • array: number[]

      総和を求める数値のリスト

    Returns number

    配列の総和

  • Returns the tangent of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns the hyperbolic tangent of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

  • Returns the integral part of the a numeric expression, x, removing any fractional digits. If x is already an integer, the result is x.

    Parameters

    • x: number

      A numeric expression.

    Returns number