|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re: numeric values acting funnyby VSarkiss (Monsignor) |
| on Dec 10, 2004 at 21:03 UTC ( [id://414046]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Your problem isn't in Perl, but in how numbers are represented. There's an old rule in numerical analysis: Never subtract very close values from each otherThe problem, in very basic terms, is that your variables are the value you want, plus or minus some small "epsilon". If you subtract two very close values, all you end up with is ε1 ± ε2; in other words, garbage. Your best bet is to restructure the formulas so the subtraction isn't necessary.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||