Module Float


module Float: sig  end
Floating-point manipulation and information routines



Comparison


val compare : float -> float -> int
Just Pervasives.compare constrained to float
val fcmp : epsilon:float -> float -> float -> int
Like compare, but takes an extra epsilon value to use in figuring out if the floats are 'close enough' to be considered equal. See The Art of Computer Programming, 4.2.2. As an example, fcmp ~epsilon:0.00001 5.000005 5.000006 returns 0, meaning 5.000005 ~~ 5.000006.


Informational


val isfinite : float -> bool
Returns True if x is a finite value
val isinf : float -> bool
Returns True if x is infinite
val isnan : float -> bool
Returns True if x is nan
val isnormal : float -> bool
Returns True if x is a normal number
val iszero : float -> bool
Returns True if x is 0.0 or -0.0
val signbit : float -> bool
Returns True if the sign bit of x is set


Other stuff


val copysign : float -> float -> float
copysign x y returns a copy of x with the same sign as y.