Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinity and NaN #7

Open
MarcoCostantini opened this issue May 21, 2020 · 0 comments
Open

Infinity and NaN #7

MarcoCostantini opened this issue May 21, 2020 · 0 comments

Comments

@MarcoCostantini
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant