Really really fast BASIC handheld

01112019, 07:11 AM
Post: #9




RE: Really really fast BASIC handheld
Hallo!
I have tried the NQueen Benchmarks. The unstructured BASIC version with labels, because SmileBasic has no line numbers. With OPTION DEFINT and a outer loop of 1000 I got this this time: 11.97 seconds, so less than 12 msecs for one run. No bad for an interpreted language. And I tried the structured version in BASIC with same conditions: OPTION DEFINT and outer loop of 1000 12.52 sec, so 12.5 msec for one run. Funny, the goto version is faster than the version with repeat, while and for. And I have tried the Savage Benchmarks. I have found 2 versions in this forum (why using 2 definitions?): FOR I = 1 TO 2499 A=TAN(ATAN(EXP(LOG(SQR(POW(A+1,2)))))) NEXT Time with a outer loop of 1000: 14.75 sec, so 14.75 msec per run. 2. Version: FOR I = 1 TO 2499 A=TAN(ATAN(EXP(LOG(SQR(A*A)))))+1 NEXT Time with a outer loop of 1000: 13.42 sec, so 13.42 msec per run. The result of A is 2500 in both cases. And I have tried to find the error with 2500A. But it shows than 0. I have found the first quirk of this BASIC. It show the floating point number with zeros and not a EE or so. If you calculate 69! the answer is several lines along with the many trailing zeros. Strange! But the precision inside is good. I have calculate PI or e with several thousand digits. And there is no problem as far as I know. I using the 3DS for fast grafic output, so the big or very small number output is not a problem. If you are interested in the codes, I can post it here. Bernd 

« Next Oldest  Next Newest »

User(s) browsing this thread: 4 Guest(s)