Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BitAnd() limitation?
Message
De
12/08/2004 12:52:21
 
 
À
12/08/2004 11:30:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00931430
Message ID:
00932810
Vues:
19
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform