printOn: bug on FloatD

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

printOn: bug on FloatD

Roland Plüss-2
Seen on 3.2.5 , also reproducable on 3.2.91

Run "gst" and enter "0.01" and you get

Object: 1 error: The program attempted to divide a number by zero
ZeroDivide(Exception)>>signal (ExcHandling.st:254)
SmallInteger(Number)>>zeroDivide (SysExcept.st:1386)
Fraction>>setNumerator:setDenominator: (Fraction.st:485)
Fraction class>>numerator:denominator: (Fraction.st:66)
Fraction>>- (Fraction.st:151)
FloatD(Float)>>printOn:special: (Float.st:535)
FloatD(Float)>>printOn: (Float.st:436)
FloatD(Object)>>printString (Object.st:546)
FloatD(Object)>>printNl (Object.st:582)

Reducable: always if FloatD is used, not if Float is used

Problem seems to be in Fraction.st:151 triggered by the line:

sameDown := sameDown and: [(num - eps) // weight = digit].

in Float.st:533

The "num - eps" part triggers the failure in the first run of the loop.

--
Yours sincerely
Plüss Roland

Leader and Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- As well as various Blender export scripts und game tools


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (201 bytes) Download Attachment