Rule 156e-dec-float
Decoding
(156)
Comments
Every JSON number decodes, integers among them, as the nearest floating-point number. A number too large for a finite floating-point number decodes as the infinity of its sign, by the rounding of floating-point constants. An incoming is the number , and decodes as the float , not . No boundary value decodes as NaN.
TeX source
\defnrule[r:e-dec-float]
{j\in\effJNum}
{\Dec{\tFloat}(j)=\efffloat(j)}Tests (4)
- elm / MinimalPipeFloatTestA pipe at `Float`: the value the driver sends in comes back out.
- elm / PortEchoFloatTestA `Float` sent out through a port comes back unchanged through an incoming port, for each of seven sample values.
- elm / PortPipeScalarsTestJSON numbers, Booleans, strings and `null` received at `Float`, `Int`, `Bool`, `String` and `()` go out as they came.
- elm / StandardA88PortNegativeZeroTest`-0` sent out through a port arrives as `+0`.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:e-dec-float] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.