davecardwell has asked for the wisdom of the Perl Monks concerning the following question:
Fixed! I had thought it might be an internal storage problem as a floating point, but couldn't find anything, but then found a pesky sprintf in a lesser-used module. Thank you to all who helped.
When doing a >= on three variables, ala:
$hash{'v1'} + $hash{'v2'} >= $value
it returns false when it should return true. When I print the variables before the if it may print, for example, 1742 + 0 >= 1742, but return false.
Most of the time the code works as expected, and I cannot find any changes in the methods of retrieval for the values. The hash values are from a database. The code is running in a mod_perl environment.
Any thoughts on what might be causing this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: >= returning unexpected result
by tlm (Prior) on Apr 12, 2005 at 10:44 UTC | |
|
Re: >= returning unexpected result
by gjb (Vicar) on Apr 12, 2005 at 10:44 UTC | |
|
Re: >= returning unexpected result
by cog (Parson) on Apr 12, 2005 at 09:47 UTC | |
|
Re: >= returning unexpected result
by polettix (Vicar) on Apr 12, 2005 at 09:48 UTC | |
|
Re: >= returning unexpected result
by ysth (Canon) on Apr 12, 2005 at 09:59 UTC | |
by davecardwell (Initiate) on Apr 12, 2005 at 10:34 UTC | |
|
Re: >= returning unexpected result
by davecardwell (Initiate) on Apr 12, 2005 at 10:33 UTC | |
by tlm (Prior) on Apr 12, 2005 at 11:12 UTC | |
|
Re: >= returning unexpected result
by jbrugger (Parson) on Apr 12, 2005 at 10:33 UTC | |
by davecardwell (Initiate) on Apr 12, 2005 at 10:43 UTC |