Divide by 2.

Remove the fractional part by taking an int( of it or subtracting the fPart( from it. Basically, always round down. It is covered in Xeda's code.

Truncation, by my best understanding, is "chopping off" digits. ]]>

I understand the left shift n times being equivalent to multiplying with 2^n, but I do not understand the right shift:

a right shift is division with truncation of the fractional part

I live in Germany, so I thought I would not understand because of my English. But I researched the word truncation, but I do not understand it

]]>But no, they are not expressly supported, so you do actually need to emulate them. I don't know how familiar you are with the math behind those operations, but a left shift n times is equivalent to multiplying the number by 2^{n} and a right shift is division with truncation of the fractional part. To test specific bits, I was pretty sure that we had a routine for that somewhere, but here is one that should work to test bit N of X:

` ``.5≤fPart(.5X2^-N`

Also, be careful not to try to over-emulate. A lot of routines that you might need to rewrite might have a very simple BASIC function. For example, if you wanted to emulate the following, where 'c' refers to an carry flag:

` ``0→A While X≠0 X>>1→X If c=1 A+Y→Y Y<<1→Y EndWhile`

That can be optimised in BASIC to:

` ``X*Y→A`