to test speeds:
iTimerStart=timer()
for i = 1 to 1000000
smallvariable=3
smallvariable=smallvariable-1
inc smallvariable
smallvariable=3*1
next i
iTimerEnd=timer()
iSmallIntTime = (iTimerEnd-iTimerStart)
iTimerStart=timer()
for i = 1 to 1000000
largevariable=435340324
largevariable=largevariable-432508
inc largevariable
largevariable=9034*3249
next i
iTimerEnd=timer()
iLargeIntTime = (iTimerEnd-iTimerStart)
iTimerStart=timer()
for i = 1 to 1000000
smallvariable#=3.4350
smallvariable#=smallvariable#-1.2985
inc smallvariable#
smallvariable#=3*1.9834
next i
iTimerEnd=timer()
iSmallhTime = (iTimerEnd-iTimerStart)
iTimerStart=timer()
for i = 1 to 1000000
largevariable#=4353454.2983
largevariable#=largevariable#-432508.2834
inc largevariable#
largevariable#=9034.3452*3249.4532
next i
iTimerEnd=timer()
iLargehTime = (iTimerEnd-iTimerStart)
iTimerStart=timer()
for i = 1 to 1000000
smallvariable#=300.435093
smallvariable#=smallvariable#-100.298542
inc smallvariable#
smallvariable#=300.567567*1.98345
next i
iTimerEnd=timer()
ilargeaftdechTime = (iTimerEnd-iTimerStart)
iTimerStart=timer()
for i = 1 to 1000000
smallvariable#=300.4
smallvariable#=smallvariable#-100.2
inc smallvariable#
smallvariable#=300.5*1.9
next i
iTimerEnd=timer()
iSmallaftdechTime = (iTimerEnd-iTimerStart)
print "Small int = "+str$(iSmallIntTime)
print "Large int = "+str$(iLargeIntTime)
print "Small # = "+str$(iSmallhTime)
print "Large # = "+str$(iLargehTime)
print "less after decimal # = "+str$(iSmallaftdechTime)
print "more after decimal # = "+str$(iLargeaftdechTime)
sync
wait key
my result:
small integer:31
large integer:33
small real#:73
large real#:57
less digits after decimal#:59
more digits after decimal#:383
some later tests:
(3 before and 6 after decimal):341
(7 before and 6 after decimal):335
just thought this might be useful to some people
if u have more information on this it would be appreciated
i thought the computer treated a real number as x.000000, but i guess it treats it as x, and when there are more digits x takes more time to calculate. from the tests i also assume it stores reals as 000000x.0 and 00xxxxx.0 (donno what exact number of 0s before x would be)
thanks to STE for the code
Chris