Fun with Number readFrom: What should we do ?

stéphane ducasse ducasse at iam.unibe.ch
Sat Apr 29 07:54:50 UTC 2006


>
> I added the bug report and a few test cases at
> http://bugs.impara.de/view.php?id=3512 last night.

thanks.

>
> I have a first implementation of SqNumberParser.
> It is more convenient to have a class than a set of messages (see  
> how many are
> necessary in Number>>readFrom:), because we can store some  
> intermediate
> results and better optimize Float reading (number of trailing  
> zeroes is an
> example that can save useless computations). Relax, creating a  
> class does not
> spoil efficiency.

:)))))))))

> The second advantage of SqNumberParser is that it is a good  
> starting point for
> those wanting their own extension for Number parsing as suggested  
> by Diego
> and Francisco.
> The class could easily have other extensions like indicating the  
> error in the
> TextEditor, like for code...
>
> So far, i suppressed the bugs i know, and the class read Integer  
> ScaledDecimal
> and Float (including nan infinity and negative zero), and pass all the
> NumberParsingTests successfully.

:)
So this is crying for new tests :)

> However i still have the bellerophon algorithm (from tony's  
> reference) failing
> with last bit incorrect in a few cases (i can check that with  
> asTrueFraction
> for number greater than 1.0 timestwoPower: 53). So i do not release  
> it yet.
>
> Float>>absPrintOnExactly;base: works rather well and is a good  
> candidate for
> testing readFrom:. However, i do not over trust it, because it  
> includes the
> same code that bugged absPrintOn: (See note in
> http://bugs.impara.de/view.php?id=3493) : it adds 1 to a digit without
> testing if digit=(base-9)... I did not reveal the bug yet.


Nicolas to help us harvesting for 3.9 could you provide us with a  
list of the ready
to harvest items.

Stef




More information about the Squeak-dev mailing list