Does anyone know WHY floats are limited to six significant digits? Perhaps this was a design of Blitz3D to increase gaming performance but why have such a limiting limit in BlitzPlus which is MUCH more geared towards apps.
I have heard that floats keep more than 6 significant digits internally but that really doesn't help because at some point you (or at least I do) have to get at that value and do something with it.
The program I am currently writing takes a lot of floating point calculations and converts them to integer values but not by using Int, Floor, or Ceil. It multiplys them by 10,000 to cause the 4 MSD's (MostSigDigit's) of the decimal part to be part of the integer. It then prints out this information to the screen and to another computer via serial cable in different formats depending on if the number is supposed to be metric, inch, or neither.
It appears that I may be losing accuracy do to rounding/clipping caused by the 6 digit limitation. I need numbers that are accurate to 4 decimal places (.0001)and when they also contain 2 integer digits (12.), that leaves no extra digits (6digits=12.0001) left to solve mathematical functions that I apply to it.
I just don't see why BlitzPlus has to only use 6 digits.
Running this sample code:
12.3457
12.3457
24.6913
So it appears that Blitz keeps the actual numbers internally (otherwise the answer should have been 24.6914) but the results shown to me on the screen (which I told you above I need to get to) are not the actual values (they are rounded).
This makes debugging difficult as well since the debugging variable pane also rounds the numbers to 6 digits.
Since I am concerned that the numbers are accurate to 4 decimal places, I can't tell WHY the numbers are what they are. For instance, "Did Blitz just round them up/down or did my math calculations actually give that result?" I don't know which it is.
I would really like to see BlitzPlus return at least 8 significant digits.
I have heard that floats keep more than 6 significant digits internally but that really doesn't help because at some point you (or at least I do) have to get at that value and do something with it.
The program I am currently writing takes a lot of floating point calculations and converts them to integer values but not by using Int, Floor, or Ceil. It multiplys them by 10,000 to cause the 4 MSD's (MostSigDigit's) of the decimal part to be part of the integer. It then prints out this information to the screen and to another computer via serial cable in different formats depending on if the number is supposed to be metric, inch, or neither.
It appears that I may be losing accuracy do to rounding/clipping caused by the 6 digit limitation. I need numbers that are accurate to 4 decimal places (.0001)and when they also contain 2 integer digits (12.), that leaves no extra digits (6digits=12.0001) left to solve mathematical functions that I apply to it.
12.3456 a number with only 6 digits + 12.3456 --------- 24.6912 12.345653 what it would be with 2 extra digits + 12.345670 ----------- 24.691323 a=24.691323 12.3456 53 what it would be if Blitz is clipping extra digits + 12.3456 70 --------- -- 24.6912 03 a=24.6912 12.3457 53 what it would be if Blitz is rounding extra digits + 12.3457 70 --------- -- 24.6914 00 a=24.6914As you can see, I could get 24.6912, 24.6913, or 24.6914 as a result depending on what goes on inside of Blitz. Clipping the extra digits goes under. Rounding the extra digits may make it go under or higher.
I just don't see why BlitzPlus has to only use 6 digits.
Running this sample code:
A# = 12.345653 B# = 12.345670 C# = A# + B# Print A# Print B# Print C# WaitKey Endproduces this result:
12.3457
12.3457
24.6913
So it appears that Blitz keeps the actual numbers internally (otherwise the answer should have been 24.6914) but the results shown to me on the screen (which I told you above I need to get to) are not the actual values (they are rounded).
This makes debugging difficult as well since the debugging variable pane also rounds the numbers to 6 digits.
Since I am concerned that the numbers are accurate to 4 decimal places, I can't tell WHY the numbers are what they are. For instance, "Did Blitz just round them up/down or did my math calculations actually give that result?" I don't know which it is.
I would really like to see BlitzPlus return at least 8 significant digits.