Printing:
It has been decided to return exception on NaNs and Infs and to return a Result from print functions for this reason. This is done.
Rationals are converted into floats before printing.
Currently using NumberUtils.dtoa to print floats (and rationals). This should be fine, but at the very least many tests are needed to make sure it always results in a valid json number.
Currently waiting for arbitrary precision and decimal number parsing to land in Grain before making a final judgment.
Parsing of negative zero value has been mentioned on Grain Discord, but not decided upon. May want to parse as negative floating point heap number in order to preserve meaning after round trip parse->toString.
Printing: It has been decided to return exception on NaNs and Infs and to return a Result from print functions for this reason. This is done.
Rationals are converted into floats before printing.
Currently using
NumberUtils.dtoa
to print floats (and rationals). This should be fine, but at the very least many tests are needed to make sure it always results in a valid json number.Currently waiting for arbitrary precision and decimal number parsing to land in Grain before making a final judgment.