[squeak-dev] Float parsed as a Fraction bug

Levente Uzonyi leves at elte.hu
Wed Aug 6 18:43:37 UTC 2014


On Wed, 6 Aug 2014, Eliot Miranda wrote:

> Hi All,
>     Squeak trunk also suffers from the Float parsed as a Fraction bug:
> 
> 1e-8 class Fraction
> 1.0e8 class Float

I'm not entirely sure about it being a bug. I've checked Squeak 3.8 
(pre-SqNumberParser), and it also parsed that literal as a Fraction. If I 
want a Float, I can be explicit and use 1.0e-8.

I made a modified version of Fraction >> #printOn:base: which outputs the 
literal format if possible. The change "fixes" the debugger (note that 
itw was way less broken in Squeak than in Pharo anyway).
The only drawback I found is that some fractions become a bit more 
"complex" when printed, e.g. 3/4 => 75e-2


Levente

> 
> --
> eek! Eliot
> 
>


More information about the Squeak-dev mailing list