Shared ASCII infinity and NaN spellings #
The caller supplies the special-value constructors and interprets the diagnostic suffix. The scanner accepts case-independent Inf/Infinity/NaN/sNaN and decimal payload digits. An absent suffix denotes zero; the binding chooses its meaning.
def
FloatLib.Numerics.SpecialText.parseSpecial
{α : Type}
(infinity : Bool → α)
(nan : Bool → Bool → ℕ → α)
(negative : Bool)
(characters : List Char)
:
Option α
Parse the unsigned part of a special value, consuming the entire input.
The nan constructor receives the sign, signaling bit, and payload, in that order.
Instances For
Infinity output preserves the sign and uses the full IEEE name.