-
containers
-
containers.data
-
containers.monomorphic
-
containers.sexp
-
containers.top
Library
Module
Module type
Parameter
Class
Class type
Basic operations on floating-point numbers
- since 0.6.1
val nan : t
Equal to Stdlib
.nan.
val max_value : t
Positive infinity. Equal to Stdlib
.infinity.
val min_value : t
Negative infinity. Equal to Stdlib
.neg_infinity.
val max_finite_value : t
Equal to Stdlib
.max_float.
val epsilon : t
The smallest positive float x such that 1.0 +. x <> 1.0
. Equal to Stdlib
.epsilon_float.
val is_nan : t -> bool
is_nan f
returns true
if f is NaN, false
otherwise.
type 'a printer = Format.formatter -> 'a -> unit
type 'a random_gen = Random.State.t -> 'a
val hash : t -> int
val random : t -> t random_gen
val random_small : t random_gen
val random_range : t -> t -> t random_gen
val sign_exn : t -> int
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.
- since 0.7
val to_int : t -> int
Alias to int_of_float
. Unspecified if outside of the range of integers.
val of_int : int -> t
Alias to float_of_int
.
val to_string : t -> string
val of_string_exn : string -> t
Alias to float_of_string
.
- raises Failure
in case of failure.
- since 1.2
val of_string : string -> t
Alias to float_of_string
.
- deprecated
since 1.2, use
of_string_exn
instead.
- raises Failure
in case of failure.
Equality with allowed error up to a non negative epsilon value.
Return the class of the given floating-point number: normal, subnormal, zero, infinite or nan (not a number).
Infix Operators
- since 0.17
module Infix : sig ... end