in reply to Problems with defining hashes
Consider that 5.0, 5.5 and 0.1 have not an exact representation inside the computer, due to its binary nature and finite bits per number; given the fact that your cycles start from different starting points (5.0 the first, 5.5 the second), you end up having slightly different number in $mag in the first and second loop, i.e. different keys in the hash.
I would suggest that you fix the magnitudes somewhere (an array, for example), then use some integer index just to be sure not to mess things up.
Flavio
Don't fool yourself.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problems with defining hashes
by ysth (Canon) on Mar 30, 2005 at 18:47 UTC | |
by polettix (Vicar) on Mar 30, 2005 at 23:38 UTC | |
|
Re^2: Problems with defining hashes
by Annemarie (Acolyte) on Mar 30, 2005 at 23:27 UTC |