[futurebasic] Strange unsinged integer behavior

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2000 : Group Archive : Group : All Groups

From: "Wolf, John" <JWOLF@...>
Date: Tue, 28 Nov 2000 10:26:13 -0600
Can someone explain the behavior of unsigned variables in FB3? In my mind,
they simply don't behave the way I expect, and as far as I can tell, they
really have no use.

For example:

DIM x&`, y&`, z#

x&`=&hFFFFFFFF
y&`=&h00000001

PRINT X&` , STR$(X&`)

'I would have expected the same results from the print and the str$().
'FB3 reults are 4294967295 and -1

IF x&`>y&` THEN PRINT "This should Print."

'Since these are unsigned variables, shouldn't this evaluate as true?
'FB3 evaluates this as false.

z# = x&`>>1
PRINT z#

'I thought the shift operator was always done in integer math.
'FB3 result is  -.5.

DO
UNTIL MOUSE(_down)