Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BitAnd() limitation?
Message
From
12/08/2004 12:52:21
 
 
To
12/08/2004 11:30:15
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00931430
Message ID:
00932810
Views:
20
Now you can see the 52 bit.
CLEAR

*** FULL TEST
x=0
? 'zero'
?
FOR k=0 TO 52
	IF Test(m.x,m.k)
  		?? TRANSFORM(m.k,"@R < 99 >")
  	ENDIF
NEXT
* PREPARE A FULL 53 BITS SET TO 1 
FOR k=0 TO 52
	x=m.x+2^m.k
NEXT
? '111...'
? TRANSFORM(m.x*2^-32,"@R0")
FOR k=0 TO 52
	IF Test(m.x,m.k)
  		?? TRANSFORM(m.k,"@R < 99 >")
  	ENDIF
NEXT

FUNCTION Test
LPARA	MasterBit, TestBit

#IF VERSION(5)<900
	RETURN BITTEST(EVALUATE(TRANSFORM(m.MasterBit*2^MIN(0,32*SIGN(31-m.TestBit)),"@0")), m.TestBit%32)
#ELSE
	RETURN BITTEST(m.MasterBit*2^MIN(0,32*SIGN(31-m.TestBit)), m.TestBit%32)
#ENDIF
To use EVAL(TRANSFORM( is demential,
but i do not have time in order to find one better solution.

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform