fixing various corner case bugs. the new implementation uses integers
for intermediate computations to improve precision.
Big exponents now fail parsing instead of a runtime assertion.