ion-docs icon indicating copy to clipboard operation
ion-docs copied to clipboard

Clarify whether numeric stop characters are required after special float values

Open popematt opened this issue 2 years ago • 1 comments

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.

popematt avatar Sep 08 '22 23:09 popematt

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.

rmarrowstone avatar Sep 12 '22 23:09 rmarrowstone