Rule 141e-enc-float
Encoding
(141)
Comments
The sign of a zero is not kept: encodes as the JSON number (Section 8.1).
TeX source
\defnrule[r:e-enc-float]
{\sv\in\effFltFin}
{\Enc{\tFloat}(\sv)=\sv}Tests (5)
- 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`.
- elm / StandardA88PortNonFiniteTestA NaN or an infinity sent out through a port arrives as JSON `null`.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:e-enc-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.