laziness, impatience, and hubris | |
PerlMonks |
Re: When 1000 is less than 1000by SavannahLion (Pilgrim) |
on Sep 28, 2010 at 04:00 UTC ( [id://862349]=note: print w/replies, xml ) | Need Help?? |
After reading the responses and dealing with a little downtime at work, I went through the code and finally pinpointed the problematic assignment at:
Even though the values plugged into the formula come out to 1000, I guess that isn't the case with the floating numbers. Since I didn't want to bang my head on this forever I figured I can somewhat predict what numbers will be dumped out by the formula. My kludge is to compare the four known values with each other then jump the entire block of problematic code if they equal each other. I can't believe this never occurred to me. I rarely mix whole integers with floats and this is the first time I've done any comparisons. In retrospect, this is something I should have remembered from my first year in course work. Such as never using a float value to control a loop. Should have puzzled this out on my own with the realization I was comparing a float to an integer. Oh well, I'm not happy about the kludge, but I can live with it.
In Section
Seekers of Perl Wisdom
|
|