Module Js.Math
Bindings to the functions in the Math object
JavaScript Math API
val _E : floatEuler's number
val _LN2 : floatnatural logarithm of 2
val _LN10 : floatnatural logarithm of 10
val _LOG2E : floatbase 2 logarithm of E
val _LOG10E : floatbase 10 logarithm of E
val _PI : floatPi... (ratio of the circumference and diameter of a circle)
val _SQRT1_2 : floatsquare root of 1/2
val _SQRT2 : floatsquare root of 2
val abs_int : int -> intabsolute value
val abs_float : float -> floatabsolute value
val acos : float -> floatarccosine in radians, can return NaN
val acosh : float -> floathyperbolic arccosine in raidans, can return NaN, ES2015
val asin : float -> floatarcsine in radians, can return NaN
val asinh : float -> floathyperbolic arcsine in raidans, ES2015
val atan : float -> floatarctangent in radians
val atanh : float -> floathyperbolic arctangent in radians, can return NaN, ES2015
val atan2 : y:float -> x:float -> floatarctangent of the quotient of x and y, mostly... this one's a bit weird
val cbrt : float -> floatcube root, can return NaN, ES2015
val unsafe_ceil_int : float -> intmay return values not representable by int
val ceil_int : float -> intsmallest int greater than or equal to the argument
val ceil_float : float -> floatsmallest float greater than or equal to the argument
val clz32 : int -> intnumber of leading zero bits of the argument's 32 bit int representation, ES2015
val cos : float -> floatcosine in radians
val cosh : float -> floathyperbolic cosine in radians, ES2015
val exp : float -> floatnatural exponentional
val expm1 : float -> floatnatural exponential minus 1, ES2015
val unsafe_floor_int : float -> intmay return values not representable by int
val floor_int : float -> intlargest int greater than or equal to the arugment
val floor_float : float -> floatval fround : float -> floatround to nearest single precision float, ES2015
val hypot : float -> float -> floatpythagorean equation, ES2015
val hypotMany : float array -> floatgeneralized pythagorean equation, ES2015
val imul : int -> int -> int32-bit integer multiplication, ES2015
val log : float -> floatnatural logarithm, can return NaN
val log1p : float -> floatnatural logarithm of 1 + the argument, can return NaN, ES2015
val log10 : float -> floatbase 10 logarithm, can return NaN, ES2015
val log2 : float -> floatbase 2 logarithm, can return NaN, ES2015
val max_int : int -> int -> intmax value
val maxMany_int : int array -> intmax value
val max_float : float -> float -> floatmax value
val maxMany_float : float array -> floatmax value
val min_int : int -> int -> intmin value
val minMany_int : int array -> intmin value
val min_float : float -> float -> floatmin value
val minMany_float : float array -> floatmin value
val pow_float : base:float -> exp:float -> floatbase to the power of the exponent
val random : unit -> floatrandom number in [0,1)
val random_int : int -> int -> intrandom number in [min,max)
val unsafe_round : float -> introunds to nearest integer, returns a value not representable as int if NaN
val round : float -> floatrounds to nearest integer
val sign_int : int -> intthe sign of the argument, 1, -1 or 0, ES2015
val sign_float : float -> floatthe sign of the argument, 1, -1, 0, -0 or NaN, ES2015
val sin : float -> floatsine in radians
val sinh : float -> floathyperbolic sine in radians, ES2015
val sqrt : float -> floatsquare root, can return NaN
val tan : float -> floattangent in radians
val tanh : float -> floathyperbolic tangent in radians, ES2015
val unsafe_trunc : float -> inttruncate, ie. remove fractional digits, returns a value not representable as int if NaN, ES2015
val trunc : float -> floattruncate, ie. remove fractional digits, returns a value not representable as int if NaN, ES2015