package containers
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=eb9b26eb2c3cf04fc5157d256eb49c43552ccb5c59c568772d70315db9669784
sha512=7f4cf5112c8047fd789c04129745dbe9783aa94390e8983f86408053b0af637e2a9cfce1559ce466b1b6ff7c01fd52d8685f5db1d1c0dda2c0aa138f90606a50
doc/containers/CCFloat/index.html
Module CCFloat
Source
Basic operations on floating-point numbers
nan
is Not a Number (NaN). Equal to Stdlib.nan
.
max_value
is Positive infinity. Equal to Stdlib.infinity
.
min_value
is Negative infinity. Equal to Stdlib.neg_infinity
.
max_finite_value
is the largest finite float value. Equal to Stdlib.max_float
.
epsilon
is the smallest positive float x such that 1.0 +. x <> 1.0
. Equal to Stdlib.epsilon_float
.
abs x
is the absolute value of the floating-point number x
. Equal to Stdlib.abs_float
.
round x
returns the closest integer value, either above or below. For n + 0.5
, round
returns n
.
sign_exn x
will return the sign of x
as 1, 0
or -1
, or raise an exception TrapNaN
if x
is NaN. Note that infinities have defined signs in OCaml.
Alias to int_of_float
. Unspecified if outside of the range of integers.
Alias to float_of_int
.
Alias to float_of_string
.
Equality with allowed error up to a non negative epsilon value.
classify x
returns the class of the given floating-point number x
: normal, subnormal, zero, infinite or nan (not a number).