Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BitAnd() limitation?
Message
From
12/08/2004 11:19:53
 
 
To
12/08/2004 10:55:46
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00931430
Message ID:
00932755
Views:
21

Thanks for your help Fabio, but it does not work either. if i check against a testbit=32 or 33 it returns .f.


It return .T. on my PC.

this is a full test:
CLEAR
****** *** the following returns .f. (not correct, should be .t.)
** THIS RETURN .T.
?Test(;
	2^1 + ;
	2^2 + ;
	2^3 + ;
	2^4 + ;
	2^5 + ;
	2^6 + ;
	2^7 + ;
	2^8 + ;
	2^9 + ;
	2^10 + ;
	2^11 + ;
	2^12 + ;
	2^13 + ;
	2^14 + ;
	2^15 + ;
	2^16 + ;
	2^17 + ;
	2^18 + ;
	2^19 + ;
	2^20 + ;
	2^21 + ;
	2^22 + ;
	2^23 + ;
	2^24 + ;
	2^25 + ;
	2^26 + ;
	2^27 + ;
	2^28 + ;
	2^29 + ;
	2^30 + ;
	2^31 + ;
	2^32 + ;
	2^33, ;
	32)

*** 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...'
?
FOR k=0 TO 52
	IF Test(m.x,m.k)
  		?? TRANSFORM(m.k,"@R < 99 >")
  	ENDIF
NEXT


FUNCTION Test
LPARA	MasterBit, TestBit
RETURN BITTEST(m.MasterBit*2^MIN(0,32*SIGN(31-m.TestBit)), m.TestBit%32)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform