Module Utils.Float

Float implementation.

include Comparable with type t = float
type t = float
val equal : t -> t -> bool

Equality over t.

val compare : t -> t -> int

Comparison over t. compare x y returns 0 iff equal x y = 0. If x and y are not equal, it returns a negative integer iff x is lesser than y and a positive integer otherwise.

val hash : t -> int

A hash function over t.

val set_precision : float -> unit

Set the precision of equal and compare for float. If the precision is p, then the floats x and y are equal iff abs(x-y) < p. By default, the precision is 1e-8 (that is 0.864 milliseconds if floats represent days).

val round : t -> int

Round a float to the nearest integer.