Hi... I am not very sure if I should post it here or to report Darkbasic this "bug" to "Bugs Report" there... but I just encountered this "bug" about Float command, with decimal.
When I make number through string (as Float, not "as STRING") (in this case, 999.9), after compiled, it suddenly said this "999.900024414" instead... I tested all numbers and only two out of ten are perfectly correct...
Here the whole ten (zero is "tenth" if you wondered) results are; i am removing all numbers before decimal, to save my type to fill in since they all are just same as if it's unaffected.
.0 = .0 (in fact, it's removed however... but still correct as you can tell that)
.1 = .099975586
.2 = .200012207
.3 = .299987793
.4 = .400024414
.5 = .5 (another correct one as the second one)
.6 = .599975586
.7 = .700012207
.8 = .799987793
.9 = .900024414
If you look it closer between .0 to .5 and .6 to .9, others than the first digit in decimal, they both are repeated...
Is it really a bug? I did looked anywhere but honestly, it seem like it's only direct-return by itself... just no formula or no math affect that float-string, just completely original result
In other word...
Number# AS FLOAT
Number# = 999.9
TEXT 5, 100, STR$(Number#)
` In my view as well as output, the screen will display this --> 999.900024414
That's it. Really!
Is it really a bug of Float or is there anything can I do about those error numbers that should not be appeared?
Thank you in advance.