in reply to Re: Numeric Comparisons Randomly Giving the Wrong Result
in thread Numeric Comparisons Randomly Giving the Wrong Result
1. use integer; 2. $x = 10/3; 3. # $x is now 3, not 3.33333333333333333
If only addition and subtraction are being used, should be fine - if other arithmetic operations are happening, wouldn't that result in a loss of precision?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Numeric Comparisons Randomly Giving the Wrong Result
by Corion (Patriarch) on Sep 30, 2010 at 13:43 UTC | |
by mjscott2702 (Pilgrim) on Sep 30, 2010 at 14:19 UTC | |
by Corion (Patriarch) on Sep 30, 2010 at 14:52 UTC | |
by mjscott2702 (Pilgrim) on Sep 30, 2010 at 14:56 UTC | |
by halfcountplus (Hermit) on Sep 30, 2010 at 14:51 UTC | |
by mjscott2702 (Pilgrim) on Oct 01, 2010 at 10:59 UTC |