SML# Document Version 3.7.1
26.12 IEEE_REAL
Provide floating-point number representations in IEEE standard.
signature IEEE_REAL =
sig
type decimal_approx = {class : float_class,
sign : bool,
digits : int list,
exp : int}
datatype float_class = NAN | INF | ZERO | NORMAL | SUBNORMAL
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO
exception Unordered
val fromString : string -> decimal_approx option
val getRoundingMode : unit -> rounding_mode
val scan : (char, ’a) StringCvt.reader -> (decimal_approx, ’a) StringCvt.reader
val setRoundingMode : rounding_mode -> unit
val toString : decimal_approx -> string
end
Structures that implement the signature
-
•
IEEEReal : IEEE_REAL