[Coco] BASIC09 - unsigned INTEGERs?

Richard E Crislip rcrislip at neo.rr.com
Sat Jan 31 23:05:11 EST 2015


On Sat, 31 Jan 2015 20:45:47 -0600
Allen Huffman <alsplace at pobox.com> wrote:

> > On Jan 31, 2015, at 8:42 PM, Robert Gault <robert.gault at att.net>
> > wrote:
> > 
> > You don't need to go quite that far to just print the result. If
> > you want to do 32-bit math you might need to separate the four
> > bytes. As suggested by others, conversion of the hex words to reals
> > might get around the negative integers.
> 
> Yes, I’d love to see someone who can figure this out. I tried all of
> that with no luck. Even did things like this:
> 
> cReal = LAND($FFFF, aInteger)
> 
> The problem is, to BASIC09, ANYTHING that is in an INTEGER with the
> high bit set, is a negative number when it comes to math. I even
> tried to convert them to strings and back, but no luck. $FFFF
> converted is still negative.
> 
> Right now, the only two working proposals are:
> 
> 1. check if it’s negative, then add when assigning it to real
> (simplest). 2. use PEEK to get the individual bytes and build it back
> 
> 		— A
> 
> 

So what happens when you multiple the negative values by negative one?


More information about the Coco mailing list