|
I have 2 floats variables: lets say "money" and "bet". At some point, I do money = money - bet; or money -= bet; bet is from 0.05 to 1 and money starts at 10000. Lets take 0.05 for bet. The first rest, money equals 9999.95. The second rest, is 9999.91. And then alternates resting 0.05 or 0.04. Why is this happening? Any idea?
(comments are locked)
|
|
The float precision is about 7 digits, thus you should not have problems with 10000 and 0.05 - but with 100000 and 0.05 this error would appear, for sure. Double precision is about 16 digits, thus the player can even break the bank without loosing precision. Flawless answer! That was the problem! Thanks! :)
Jan 05 '12 at 06:01 PM
DarkSlash
(comments are locked)
|
