0 Members and 1 Guest are viewing this topic.

Integers are usually better if you can figure out a way to use them, but occasionally you actually need fixed-point for optimal coding. Internally, fixed-point numbers are stored times 256. So 1.5 is really 368. 256 is the first number that doesn't fit in an 8-bit (1 byte) range and dividing or multiplying by 256 is very easy (remember that in Axe, dividing by a number is like int(A/B) in BASIC). Anyways, if you did 1.5*1.5, you can think of this mathematically as 368*368/(256*256) then multiplied again by 256 to convert it back to fixed point. At the assembly, you just multiply 368*368 and get rid of the lower byte of the result, keeping bits 8 to 23.

However, as soon as I saw demos of Axe (the spinning cube really got me) I decided to give it a shot.

Have you seen what Matrefeytontias is up to?http://www.ticalc.org/archives/files/fileinfo/457/45784.html

.TEST"HELLO WORLD!→Str1Text(0,0,Str1

.TEST"HELLO WORLD!→Str1Text(0,0,Str1+1

And randInt(A,B) would be rand^(B-A)+A in Axe.

P.S. At the top of the CUBE source code, some hex values are enclosed in square brackets but not passed to any variables, what does this do?