package libabsolute

  1. Overview
  2. Docs

Float arithmetic module

type t = float

Constructors

val zero : float
val one : float
val two : float
val minus_one : float

Operators

val add : float -> float -> float
val mul : float -> float -> float
val div : float -> float -> float option
val neg : float -> float
val ceil : float -> int
val floor : float -> int

Conversions

val to_int : float -> int option
val to_float : 'a -> 'a
val to_rational : float -> Mpqf.t
val of_int : int -> float
val of_float : 'a -> 'a
val of_rational : 'a Mpqf.tt -> float

Comparisons

val equal : t -> t -> bool
val compare : Stdlib.Float.t -> Stdlib.Float.t -> int

Printing

val pp_print : Stdlib.Format.formatter -> float -> unit

float light printing when decimal part is nul

val print : Stdlib.Format.formatter -> float -> unit
val to_string : float -> string
OCaml

Innovation. Community. Security.