If you only want one decimal place, use INT(value * 10) / 10.
For example:
3.000000001 becomes 3.0
3.123456789 becomes 3.1
And so on.
Try doing the math outside the PRINT. like this;Code: QB64: [Select]
_DELAY 0.050 A! = (sizedone&& / 10)
That fixed the floating point issue on my end. you might need to reformat the PRINT to get the output to look like you want but the extra numerals no longer show up on my end anyway.
I believe when you do the math in the PRINT statement it converts the numbers to floating point and that is where you start to see that .0000...1 , or there abouts, number showing up.
Indeed, doing the math outside does the trick (why??):
Just an aside: Windows limits changing _TITLE after a few hundred calls.
FOR i = 1 TO 1000000
_LIMIT 1000
_TITLE STR$(i)
NEXT
Isn't that a nice a simple little line of code to try and sort out?? And which part of that is causing the issue with the math itself is in there somewhere.... But where?
My first guess would be at asking, "Why is the first math cast to a double, while the rest is to long doubles? (See the (double) vs the (long double)?)
My second question is: If we were to change that to long double for testing, exactly where in the QB64 source would we make that change with the translation??? (And from my past experience with PRINT here, my answer would probably be, "We don't. We hide from trying to sort out PRINT issues and leave them to someone else to figure out!!")
Just an aside: Windows limits changing _TITLE after a few hundred calls.