Modify ↓
Attachments (0)
Change History (2)
comment:1 by , 16 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
comment:2 by , 16 years ago
I guess I was always under the impression that I would be shown the true value if it was some kind of a float. Like in this example, the same kind of miscalculation happens only the msgbox will display the true value $x = 6.99999999999999. Not evaluate that it is not 7 and then show me that the value is 7. Anyway, sorry for the mistake.
$x = 5
For $i = 1 to 20
$x += .1
Next
if $x <> 7 Then MsgBox(0, '', $x)
Note:
See TracTickets
for help on using tickets.

Sigh. Floating point numbers are imprecise, blah blah blah. Seriously, I've covered this about a billion times. Try using Int($x) to do a tiny bit of floating-point correction to account for the inaccuracies or don't use floating point arithmetic and then expect the results to be what you want.
Nothing to see here.