Module Js.Math
Bindings to the functions in the Math object
JavaScript Math API
val _E : floatlet _E: float;Euler's number
val _LN2 : floatlet _LN2: float;natural logarithm of 2
val _LN10 : floatlet _LN10: float;natural logarithm of 10
val _LOG2E : floatlet _LOG2E: float;base 2 logarithm of E
val _LOG10E : floatlet _LOG10E: float;base 10 logarithm of E
val _PI : floatlet _PI: float;Pi... (ratio of the circumference and diameter of a circle)
val _SQRT1_2 : floatlet _SQRT1_2: float;square root of 1/2
val _SQRT2 : floatlet _SQRT2: float;square root of 2
val abs_int : int -> intlet abs_int: int => int;absolute value
val abs_float : float -> floatlet abs_float: float => float;absolute value
val acos : float -> floatlet acos: float => float;arccosine in radians, can return NaN
val acosh : float -> floatlet acosh: float => float;hyperbolic arccosine in raidans, can return NaN, ES2015
val asin : float -> floatlet asin: float => float;arcsine in radians, can return NaN
val asinh : float -> floatlet asinh: float => float;hyperbolic arcsine in raidans, ES2015
val atan : float -> floatlet atan: float => float;arctangent in radians
val atanh : float -> floatlet atanh: float => float;hyperbolic arctangent in radians, can return NaN, ES2015
val atan2 : y:float -> x:float -> floatlet atan2: y:float => x:float => float;arctangent of the quotient of x and y, mostly... this one's a bit weird
val cbrt : float -> floatlet cbrt: float => float;cube root, can return NaN, ES2015
val unsafe_ceil_int : float -> intlet unsafe_ceil_int: float => int;may return values not representable by int
val ceil_int : float -> intlet ceil_int: float => int;smallest int greater than or equal to the argument
val ceil_float : float -> floatlet ceil_float: float => float;smallest float greater than or equal to the argument
val clz32 : int -> intlet clz32: int => int;number of leading zero bits of the argument's 32 bit int representation, ES2015
val cos : float -> floatlet cos: float => float;cosine in radians
val cosh : float -> floatlet cosh: float => float;hyperbolic cosine in radians, ES2015
val exp : float -> floatlet exp: float => float;natural exponentional
val expm1 : float -> floatlet expm1: float => float;natural exponential minus 1, ES2015
val unsafe_floor_int : float -> intlet unsafe_floor_int: float => int;may return values not representable by int
val floor_int : float -> intlet floor_int: float => int;largest int greater than or equal to the arugment
val floor_float : float -> floatlet floor_float: float => float;val fround : float -> floatlet fround: float => float;round to nearest single precision float, ES2015
val hypot : float -> float -> floatlet hypot: float => float => float;pythagorean equation, ES2015
val hypotMany : float array -> floatlet hypotMany: array(float) => float;generalized pythagorean equation, ES2015
val imul : int -> int -> intlet imul: int => int => int;32-bit integer multiplication, ES2015
val log : float -> floatlet log: float => float;natural logarithm, can return NaN
val log1p : float -> floatlet log1p: float => float;natural logarithm of 1 + the argument, can return NaN, ES2015
val log10 : float -> floatlet log10: float => float;base 10 logarithm, can return NaN, ES2015
val log2 : float -> floatlet log2: float => float;base 2 logarithm, can return NaN, ES2015
val max_int : int -> int -> intlet max_int: int => int => int;max value
val maxMany_int : int array -> intlet maxMany_int: array(int) => int;max value
val max_float : float -> float -> floatlet max_float: float => float => float;max value
val maxMany_float : float array -> floatlet maxMany_float: array(float) => float;max value
val min_int : int -> int -> intlet min_int: int => int => int;min value
val minMany_int : int array -> intlet minMany_int: array(int) => int;min value
val min_float : float -> float -> floatlet min_float: float => float => float;min value
val minMany_float : float array -> floatlet minMany_float: array(float) => float;min value
val pow_float : base:float -> exp:float -> floatlet pow_float: base:float => exp:float => float;base to the power of the exponent
val random : unit -> floatlet random: unit => float;random number in [0,1)
val random_int : int -> int -> intlet random_int: int => int => int;random number in [min,max)
val unsafe_round : float -> intlet unsafe_round: float => int;rounds to nearest integer, returns a value not representable as int if NaN
val round : float -> floatlet round: float => float;rounds to nearest integer
val sign_int : int -> intlet sign_int: int => int;the sign of the argument, 1, -1 or 0, ES2015
val sign_float : float -> floatlet sign_float: float => float;the sign of the argument, 1, -1, 0, -0 or NaN, ES2015
val sin : float -> floatlet sin: float => float;sine in radians
val sinh : float -> floatlet sinh: float => float;hyperbolic sine in radians, ES2015
val sqrt : float -> floatlet sqrt: float => float;square root, can return NaN
val tan : float -> floatlet tan: float => float;tangent in radians
val tanh : float -> floatlet tanh: float => float;hyperbolic tangent in radians, ES2015
val unsafe_trunc : float -> intlet unsafe_trunc: float => int;truncate, ie. remove fractional digits, returns a value not representable as int if NaN, ES2015
val trunc : float -> floatlet trunc: float => float;truncate, ie. remove fractional digits, returns a value not representable as int if NaN, ES2015