|laziness, impatience, and hubris|
When < isn't less thanby inelukii (Sexton)
|on Sep 11, 2003 at 18:45 UTC||Need Help??|
inelukii has asked for the
wisdom of the Perl Monks concerning the following question:
I have inherited some code that does what would appear to be a simple binning operation. However, I have discovered an error in the binning but for the life of me don't see what's wrong with the code.
Given a set of data between 0.9 and 1, the code should place it in 12 different bins.
Bin 0 is < 0.9,
Bin 1 >= 0.9 && < 0.91,
Bin 2 >= 0.91 && < 0.92,
Bin 11 >= 1.0
When run, some values get shifted down, others are placed in appropriate bins. So far, I am concerned with the < operator because it shows for example, that 0.99 is < 0.99. I hope there is a stupid mistake that I am just missing; I'd appreciate any assistance. Whether the binning algorithm is efficient or not, I'm not currently concerned with, first and foremost is that it work.
Here's the code...