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 (
SmallInteger(Number)>>zeroDivide (
Fraction>>setNumerator:setDenominator: (
Fraction class>>numerator:denominator: (
Fraction>>- (
FloatD(Float)>>printOn:special: (
FloatD(Float)>>printOn: (
FloatD(Object)>>printString (
FloatD(Object)>>printNl (

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

Problem seems to be in triggered by the line:

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


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 ( )
- Game Engine: Drag[en]gine (
, )
- As well as various Blender export scripts und game tools

help-smalltalk mailing list
[hidden email]

signature.asc (201 bytes) Download Attachment