in reply to Re^2: 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)
in thread 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)

An alternative which is used in C a lot is to make them into integers by multiplying everything by 10**N where N is the number of decimal places (or precision) you want to have in your answer. Then, when you're done, you divide the answer by 10**N and you're good.

*ponders* This sounds like a good candidate for a CPAN module doing overloaded math ... Or, you could just use Math::BigFloat (which may be overkill)

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

  • Comment on Re^3: 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals)