[ANN] Number readFrom: light version rounding to nearest float
nicolas cellier
ncellier at ifrance.com
Sun May 7 15:57:08 UTC 2006
This is related to squeak-dev subjects
- Numerics question: reading floating point constants
- Fun with Number readFrom: What should we do ?
I proposed a first version of SqNumberParser built upon Bellerophon algorithm
(using 64 bits arithmetic instead of 53 to get a correct result).
Unfortunately, this solution was quite heavy in my opinion (using a new
ArbitraryPrecisionFloat class).
It was not that efficient anyway because no access to native 64bit extended
precision arithmetic was provided from within squeak (all was emulated).
The other solution i suggested is now working. Two patches correcting
Integer>>asFloat and Fraction>>asFloat need simply being loaded from
http://bugs.impara.de/view.php?id=3564 and
http://bugs.impara.de/view.php?id=3568
Then, no more need for BellerophonAlgorithm nor ArbitraryPrecisionFloat...
Conversion is slow, but often a little faster than original readFrom:.
Solution is now a good candidate for base image inclusion (3.9 but also
earlier releases).
TODO: create a specific error like NumberParserError or NumberParserException.
Anyone interested, please do your own tests and let me know of any bug.
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Kernel-Number-SqNumberParserV2.1.cs.gz
Type: application/x-gzip
Size: 3792 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060507/b9a71458/Kernel-Number-SqNumberParserV2.1.cs.bin
More information about the Squeak-dev
mailing list
|