[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Float printString?
From: |
Robert Kuszinger |
Subject: |
Re: [Help-smalltalk] Float printString? |
Date: |
Wed, 6 Jul 2016 12:40:27 +0200 |
Dear Holger,
thanks for your comment.
The inspect is here, whatever it means..
An instance of FloatD
[1]: 224
[2]: 221
[3]: 240
[4]: 122
[5]: 184
[6]: 184
[7]: 41
[8]: 191
Instead of an inspect I checked the values in the calculation:
quo := (endHeight-startHeight)/length.
quo inspect.
Transcript showCr: 'endHeight: ',endHeight printStringIfNecessary.
Transcript showCr: 'startHeight: ',startHeight printStringIfNecessary.
Transcript showCr: 'length: ',length printStringIfNecessary.
Transcript showCr: 'Lejtés: ',quo printStringIfNecessary. #<-----
error happens here
Printout:
endHeight: 99
startHeight: 110.0
length: 56053.86243369161
*<same error msg here>*
Calculating the same in bc
(99-110.0)/56053.86243369161
-.00019623982224262149
Best regards
Robert
2016-07-06 12:08 GMT+02:00 Holger Freyther <address@hidden>:
>
> > On 06 Jul 2016, at 10:44, Robert Kuszinger <address@hidden> wrote:
> >
> > Hello!
> >
> > I've made a script to perform GRASS GIS operations automatically.
> > It was running for weeks nicely.
> >
> > Today it emerged:
> >
> > 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>>raisedToInteger: (Fraction.st:510)
>
> so the denominator is 0? Can you use >>#inspect on your float to see what
> your float looks like?
>
> holger