Re: Interpreter erroneously reading some numbers
- Posted by SDPringle Jan 25, 2015
- 1405 views
Now, arguably it should parse correctly if the string is inside the range of a double. This number I have given as an example isn't. So, what should we do with this? Should we make these numbers read as inf or should we error out and notify the user?
Extra wrinkle: 64-bit builds of euphoria can handle bigger numbers.
Matt
That exact problem is on my radar, not sure how to proceed. When a 32-bit compiler is trying to construct a 64-bit executable, I'd like #8000000000000001 to yield {#80000000,#00000001} (or {lo_dword,hi_dword}) and something similar for 80-bit floats, and when a 32-bit compiler is constructing a 32-bit executable, I'd like ^warning: precision loss messages for such values. Of course, #8000000000000000 is fine as-is, it is not so much a matter of counting digits but explicitly testing for precision loss.....
Pete
I think that is 52 bigits and a sign bit. As long as your numbers don't exceed 2^55 you have nothing to worry about because your pointers are all multiples of 8. A type routine could return true all of the time but signal a global variable or print a warning about it exceeding 2^55.