Thanks for the feedback rich, perhaps you could try this too:
a as double float
b as double float
c as double float
d as double float
e as double float
f as double float
g as double float
h as double float
a = 10.0
b = 100.0
c = 1000.0
d = 10000.0
e = 100000.0
f = 1000000.0
g = 10000000.0
h = 100000000.0
for i= 1 to 1000
a = a + 0.1
b = b + 0.1
c = c + 0.1
d = d + 0.1
e = e + 0.1
f = f + 0.1
g = g + 0.1
h = h + 0.1
cls
print "(0.1 * 1000) = ", str$(0.1 * 1000)
text 400,0, "(should be 100)"
print "10 + (0.0001 * 1000) = ", str$(a)
text 400,15, "(should be 110)"
print "100 + (0.0001 * 1000) = ", str$(b)
text 400,30, "(should be 200)"
print "1000 + (0.0001 * 1000) = ", str$(c)
text 400,45, "(should be 1100)"
print "10000 + (0.0001 * 1000) = ", str$(d)
text 400,60, "(should be 10100)"
print "100000 + (0.0001 * 1000) = ", str$(e)
text 400,75, "(should be 100100)"
print "1000000 + (0.0001 * 1000) = ", str$(f)
text 400,90, "(should be 1000100)"
print "10000000 + (0.0001 * 1000) = ", str$(g)
text 400,105, "(should be 10000100)"
print "100000000 + (0.0001 * 1000) = ", str$(h)
text 400,120, "(should be 100000100)"
sync
next i
suspend for key
Here is the output:
Why do we have 13 decimal places for 100+100 and none at all for numbers greater than 1,000,000 ? Where are the 15 digits?
other strange results:
1,000,000 + 100 (0.1 1000 times) = 1,000,125
10,000,000 + 100 (0.1 1000 times) = 10,000,000
100,000,000 + 100 (0.1 1000 times) = 100,000,000
I need to work with big numbers with some decimals (the more, the better)
Once again, How can I cast the 15 digits?