[Coco] BASIC09 - unsigned INTEGERs?

Mark McDougall msmcdoug at iinet.net.au
Wed Feb 4 05:08:58 EST 2015


On 4/02/2015 1:29 AM, Allen Huffman wrote:

> And -- due to one of the numbers will be negative, the normal maths don't
> work. That's what started this. One of the three workarounds proposed
> checks for that by doing something like
>
> if b<0 then b=b+65536
>
> ...during the assign to the REAL.

And for my money, this is the 'proper' way to do it...

> We have several ways to make it work -- but we continue to look for a
> better way :)

What's you definition of 'better'? Less CPU cycles? Less RAM usage? Because 
I think the above will be hard to beat... and you're certainly not going to 
get there with string functions!

As I said... sledgehammers and nut cracking...

Regards,

-- 
|              Mark McDougall                | "Electrical Engineers do it
|  <http://members.iinet.net.au/~msmcdoug>   |   with less resistance!"


More information about the Coco mailing list