Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BitTest'ing numbers larger then 32 bits
Message
De
01/01/2021 15:16:31
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01677684
Message ID:
01677703
Vues:
63
>
>Hi,
>
>You can write special UDF for 64 bit numbers and call if you need it.
>
>LOCAL m.lnX, m.lii
>m.lnX=0xFFFFFFFF+1
>
>FOR m.lii=1 TO 32
>?m.lii, VFP64_BITTEST(m.lnX, m.lii)
>NEXT
>RETURN
>
>PROCEDURE VFP64_BITTEST
>LPARAMETERS m.nNumericExpression1, m.nBitNumber
>RETURN IIF(m.nBitNumber<=31, BITTEST(m.nNumericExpression1, m.nBitNumber), BITTEST(m.nNumericExpression1/(0x100000000), m.nBitNumber-32))
>RETURN 
>
.
>
>MartinaJ

Martina,

Unfortunately, VFP lacks precision with large numbers.
FOR m.Bit = 32 TO 48
	? m.Bit, VFP64_BITTEST(0x0FFFFFFFFFFFF, m.Bit)
ENDFOR
There is no safe way for doing this in VFP using numeric types, I believe, as Dragan remarked.
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform