Module Utils.FloatSource

Float implementation.

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

Equality over t.

Sourceval 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.

Sourceval hash : t -> int

A hash function over t.

Sourceval 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).

Sourceval round : t -> int

Round a float to the nearest integer.