ion-docs
ion-docs copied to clipboard
Clarify whether numeric stop characters are required after special float values
The Ion Spec says, about float
and decimal
:
In the text notation, real values must be followed by one of the fifteen numeric stop-characters:
{}[](),\"\'\ \t\n\r\v\f
.
However, nan
, +inf
, and -inf
are not real numbers (i.e. not in ℝ). Furthermore, the existing implementations are not in agreement about whether a numeric stop character is required after these values.
Input | ion-java |
ion-js |
ion-rust |
---|---|---|---|
(nan-nan) |
(nan '-' nan) |
(nan '-' nan) |
invalid |
nan-inf |
nan -inf |
nan -inf |
invalid |
nan+inf |
nan +inf |
nan +inf |
invalid |
+inf+inf |
invalid | invalid | invalid |
There are inconsistencies between ion-rust
and the other two implementations, and implementations seem to be inconsistent within themselves because if nan+inf
is valid, then it seems like +inf+inf
should also be valid.
To make a question explicit: the Spec says "real values" as to whether the intention was "real numbers" (in the mathematical sense) or "real values" (as in not-null?) is not clear.