package containers

  1. Overview
  2. Docs

Basic Float functions

  • since 0.6.1
type t = float
type fpclass = Pervasives.fpclass =
  1. | FP_normal
  2. | FP_subnormal
  3. | FP_zero
  4. | FP_infinite
  5. | FP_nan
val nan : t
val max_value : t
val min_value : t
val max_finite_value : t
val epsilon : float
val is_nan : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val neg : t -> t
val abs : t -> t
val scale : t -> t -> t
val min : t -> t -> t
val max : t -> t -> t
val equal : t -> t -> bool
val compare : float -> float -> int
type 'a printer = Buffer.t -> 'a -> unit
type 'a formatter = Format.formatter -> 'a -> unit
type 'a random_gen = Random.State.t -> 'a
val pp : t printer
val print : t formatter
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 : t -> int

sign t is one of -1, 0, 1

val to_int : t -> int
val of_int : int -> t
val to_string : t -> string
val of_string : string -> t
val equal_precision : epsilon:t -> t -> t -> bool

Equality with allowed error up to a non negative epsilon value

val classify : float -> fpclass
OCaml

Innovation. Community. Security.