22.03.2010, 21:08
Alright, took a little time to do a bit more testing with your function, but it failed to round value 7 (0.699999 to 0.700000), but values 0 to 6 work just fine...
Using the value 9 does the same thing, it comes out as 0.899999
The following is how I used your function though
I tested the number you used, 13.29 -> 13.3 which works just fine, but try with using 0.69 & you'll see what my problem is...
Conclusion: This must be a Pawn Bug of some sort, 7.000000 / 10.000000 = 0.699999 (Pawn) because 7.000000 / 10.000000 = 0.700000 (Caculator)
So does anyone know a way around this bug maybe?
Using the value 9 does the same thing, it comes out as 0.899999
The following is how I used your function though
pawn Код:
valueA=7;
floatA=valueA;
// floatA is now: 7.000000
floatA/=10.0;
// floatA is now: 0.699999 (It's not 0.700000 like it should be after the divide...)
RoundToNearestTenth(floatA);
// floatA is still: 0.699999
Conclusion: This must be a Pawn Bug of some sort, 7.000000 / 10.000000 = 0.699999 (Pawn) because 7.000000 / 10.000000 = 0.700000 (Caculator)
So does anyone know a way around this bug maybe?