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

when converting big floats to OpenMath, remove the + of the exponent #31

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

Comments

@MarcoCostantini
Copy link

the XML standard requires that the floats are without the + in the exponent, see https://docstore.mik.ua/orelly/xml/schema/ch04_04.htm
Hence 10.0**20 should be converted as <OMF dec="1e20"/>, not as <OMF dec="1e+20"/>

>>> encoder.encode_bytes(converter.to_openmath([10.0**20]))
b'<OMA xmlns="http://www.openmath.org/OpenMath"><OMS cdbase="http://www.openmath.org/cd" name="list" cd="list1"/><OMF dec="1e+20"/></OMA>'
>>> 

This output in fact doesn't validate, even if the OMOBJ tag is added, see
https://www.openmath.org/validation/omvalidate.html

To validate OpenMath, it can be used also the online validator
https://www.liquid-technologies.com/online-relaxng-validator
with the grammar copied from
https://www.openmath.org/standard/om20-2019-07-01/omstd20.html#app_openmath.rng

tkw1536 added a commit to KWARC/py-openmath that referenced this issue May 21, 2020
Previously floating point numbers in exponential notation with a
positive exponent were converted to openmath incorrectly. As raised in
issue OpenMath#31 an extra "+" was added in the XML. This commit fixes the issue
by removing the "+".
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