Designing Floats upon F
Design discussion : where to put NaNs, Infinities and Zeroes ?
My first idea was to split the design in two : module F is for rational numbers m.2^n
; then we can design an FP
or Float
module with a suitable type t for floats :
type t = NaN | Plus_inf | Minus_inf | Plus_zero | Minus_zero | Float of F.t
The idea is that numbers in F.t
can be used without NaNs and such, for instance to implement interval of floats, or upper-approximation of loss-of-precision, etc.