in reply to Re: 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)
in thread 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)
So can I avoid it somehow? Stringification of the values before doing the operation solves my problem. Why is that? Is it something accumulated that gets re-set?
(I understand that it changes Perl's internal representation of what is stored in the variable, but what I wonder is how and why that changes what it does when performing the addition).
This is something that popped up in an old application where I do basically the same thing all over the place, but this particular thing haven't been a problem in the past.
Right now I have "solved" id by stringifying the value before doing the calculation, but that doesn't feel very solid.
/J
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)
by dragonchild (Archbishop) on Feb 25, 2005 at 14:24 UTC | |
|
Re^3: 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)
by Roy Johnson (Monsignor) on Feb 25, 2005 at 14:11 UTC | |
|
Re^3: 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)
by ikegami (Patriarch) on Feb 25, 2005 at 16:22 UTC |