[Coco] Why does using a decimal point instead of a zero result in faster code?

John Guin johnguin at hotmail.com
Thu Apr 30 01:03:17 EDT 2009


Say gang,

I remember back in the day a simple "trick" which resulted in faster BASIC
run times.  The trick was to a use a decimal point instead of 0 when using
the value zero.

For instance:
10 FOR I = 0 to 10000
20 IF I = 0 THEN PRINT "HELLO WORLD"
30 NEXT I

Runs slower than:

10 FOR I = 0 to 10000
20 IF I = . THEN PRINT "HELLO WORLD"
30 NEXT I

I can't remember if this has been asked here, but if it has, I certainly
don't remember the answer.

Any ideas?

John




More information about the Coco mailing list