Matthew Fluet wrote:
- One bug with the implementation of Real.fromDecimal (which also affects Real.scan and Real.fromString) in PolyML 5.2. The string_buffer[30] in Real_convc in <src>/libpolyml/reals.cpp limits the length of the string seen by strtod to 29 characters. However, the construction of the ML string at <src>/basis/Real.sml:359 can construct an arbitrarily large string. In particular, the "E" and exponent can be pushed beyond the end of the string seen by strtod:
Thanks for reporting this. I've fixed it in CVS and added it to my regression tests.
- Real.~ doesn't properly flip the sign bit on zero:
This only affected the x86 platforms and was introduced in 5.2 with the improved real number code. This implemented "Real.~ x" as "0.0 - x". I've now changed it in CVS to use the "change sign" instruction to be consistent with the other platforms although it's not clear what the correct behaviour is. The Basis Library book says "~ r produces the negation of r" and does not explicitly say what the negation of zero is. Maybe it's defined in the IEEE documents.
David