Closed ghilesZ closed 5 years ago
Thanks !
I believe the implementation is not correct.
0x1.1p1
should be 2.125
but is parsed as 17.
Oups i didn't know that. Also it seems that in hexadecimal notation, exponents are written in decimal, but should be interpreted as powers of two as 2.125 = 0x1.1 * 2^1
. I can work on a fix.
Do we agree that we should follow OCaml's lexical conventions?
Yes, it would be nice!
Btw, we should check that Z.to_string
is also complete (does it support underscores ?).
Fyi, I've rewritten Q.of_stirng in #72
This PR implements the handling of decimal point number (eg, 3.14) and scientific notation (eg, 6,674 30e−11)in Q.of_string, as requested by issue#10 (Underscores are however still not uderstood). It also adds the testing of the new features in tests/ofstring.ml test files.
The implementation is in regular OCaml (no C or assembly code is used), and performs computations that can be a bit redundant with Z.of_string (parsing of sign prefix and base prefix). These computations should maybe be put in common in future but i think this is a minor detail.