-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The file openmath-spec.litcoffee says:
Floats can't have keys other than t and v, and their values must be numbers
passing `isFinite` and failing `isNaN`.
expect( OMNode.checkJSON { t : 'f', v : -15.9, x : 'thing' } ) \
.toMatch /Key x not valid in object of type f/
expect( OMNode.checkJSON { t : 'f', v : '-15.9' } ) \
.toMatch /Not a number: -15\.9 of type string/
expect( OMNode.checkJSON { t : 'f', v : Infinity } ) \
.toMatch /OpenMath floats must be finite/
expect( OMNode.checkJSON { t : 'f', v : -Infinity } ) \
.toMatch /OpenMath floats must be finite/
expect( OMNode.checkJSON { t : 'f', v : NaN } ) \
.toMatch /OpenMath floats cannot be NaN/
but infinity and NaN are supported both by Javascript and by OpenMath, hence also
openmath-js should support them.
See
https://www.openmath.org/standard/om20-2019-07-01/omstd20.html#sec_xml-desc
https://www.openmath.org/standard/om20-2019-07-01/omstd20.html#sec_compl_xml_encoding_val
https://www.openmath.org/standard/om20-2019-07-01/omstd20.html#chgenc
Metadata
Metadata
Assignees
Labels
No labels