Utils.Float
Float implementation.
include Comparable with type t = float
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
.
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.