help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] printOn: bug on FloatD


From: Roland Plüss
Subject: [Help-smalltalk] printOn: bug on FloatD
Date: Sun, 18 Nov 2018 19:09:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]