After watching the mentiond video, I noticed that normally MicroPython compiles to bytecode, but there seems to be also a native code mode,

if @micropython.native is used at the beginning of the function. Maybe we can go much faster, if @micropython.native does work on the CG50.

I guess we need 1000 or 10000 iterations in this caae, to have an accurate result.

I'm not too familiar with how python libraries work. But I think the calculator can probably use custom made libraries.

I think to create a custom library, you would just create a .py file on a computer then put it in the same folder as your project on the calculator. Then you could call the file by using import.

I'm not sure if you could do graphics this way, but I'm reasonably sure that other custom libraries could be created doing this.

Anyway, because documentation is lacking (as far as I can tell), and because some people have inquired, here is a list of the libraries included on the calculator:

Built-in (standard library):

abs(), and, as, bin(), break, class, complex(,), continue, def, def:, def:return, del, divmod(,), elif, else, except, False, finally, float(), for, for:, for:range(), for:range(,), for:range(,,), from, global, hex(), if, if:, if:else, if:elif, if.and:else, if.or:else, import, in, input(), int(), is, lambda, len(), max(), min(), None, nonlocal, not, oct(), or, pass, pow(,), print, raise, range(), return, round(), sorted(), str(), sum(), True, try, type(), while, while:, with, yield, ().imag, ().real

Math Library:

acos(), asin(), atan(), atan2(,), ceil(), cos(), cosh(), exp(), fabs(), floor(), fmod(,), frexp(), from math import*, import math, ldexp(,), log(), log10(), math., math.e, math.pi, modf(), pow(,), sin(), sinh(), sqrt(), tan(), tanh()

Random Library:

choice(), from random import*, getrandbits(), import random, randint(,), random(), random., randrange(), seed(), uniform(,)

Symbols:

e, +, -,*,**,/,%,&,|,^,~,<,>,<=,>=,==,!,(,),[,],{,},,,:,.,;,=,',",#,\,!,_

(09-01-2018 10:40 AM)xerxes Wrote: [ -> ]The CG20 needs 39.7 seconds with BASIC. Strangely using MAT is a bit faster than using a list.

Code:

` 0->A~Z`

8->R

{R,1}->Dim Mat A

0

Do

Isz X

R->Mat A[X,1]

Do

Isz S

X->Y

While Y>1

Dsz Y

Mat A[X,1]-Mat A[Y,1]->T

If T=0 Or X-Y=Abs T

Then 0->Y

Mat A[X,1]-1->Mat A[X,1]

While Mat A[X,1]=0

Dsz X

Mat A[X,1]-1->Mat A[X,1]

WhileEnd

IfEnd

WhileEnd

LpWhile Y<>1

LpWhile X<>R

S

I've tried this on the older 9750GII (upgraded OS) and a 9750G+. I got 876 in about 45 seconds on the GII, but got a Syn Error at the IfEnd for the G+, and I don't know why yet, as it's the same code on both. Any clues?

EDIT: Ah, I forgot to follow the initial hpmuseum link, I've found the G+ code differs from the GII code. However, I'd still like to know why the newer code doesn't work. I entered the code from the link for the G+, and it errors out on List 1[X]-List1[Y]->T (with Arg Error).

(Post 275)

There are different test codes for the Casio graphing calculators, because I noticed that the 8 bit devices are faster with unstructured code

using a list, while the 32 bit ones are faster with structured code using a matrix. I remember testing the structured code on the older devices,

caused an abnormal behaviour. Deeper investigation of the problem showed, that the reason is a bug of the interpreter, but I don't remember

the details exactly.

Thanks for testing the FX-9750GII-2 (SH4a).