Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
floating-point numbers have rounding errors and our decimal system isn't too compatible to binary representation
so $var != 1 Perl's DWIM is sometimes trying to round the string representation, that's why eq seemingly "works". Rule of thumb, add integers and correct afterwards to the right magnitude.
see also Humans have too many fingers
Cheers Rolf
In reply to Re: $var == 1 fails when $var = 1
by LanX
|
|