swaroopch / edn_format

EDN reader and writer implementation in Python, using PLY (lex, yacc)
https://swaroopch.com/2012/12/24/edn-format-python/
Other
131 stars 31 forks source link

Fix parsing of exact-precision floats with a negative exposant #47

Closed bfontaine closed 6 years ago

bfontaine commented 6 years ago

As long as the e_value is positive, the code works because pow returns an int. If it’s negative, pow returns a float, and the Decimal*float operation fails because * isn’t defined for these types. Using Decimals for both operands fixes that.