Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BitAnd() limitation?
Message
De
12/08/2004 12:47:32
 
 
À
12/08/2004 11:56:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00931430
Message ID:
00932808
Vues:
19
Hi Gunnar the mysterious one is revealed: a standard VFP's Bug.

INT()/FLOOR() function have a BUG, and add a carry into the IEEE mantissa.

This bug is fixed on VFP9beta.

Repro:
CLEAR
SET FIXED OFF

X=0x001FFFFF*2^32 + 0xFFDF3B63

? 'this IEEE generate a carry into the INT() but the propagation dead and result is correct'

nDummy=m.x*2^-32	&& this is 0x001FFFFF.FFFFFFFF -> INT() is 0x001FFFFF

? INT(m.nDummy), "GOOD"
? TRANSFORM(m.nDummy,"@0") , "GOOD"
? TRANSFORM(INT(m.nDummy),"@0"), "GOOD"
? BITOR(m.nDummy,0),"GOOD"


X=0x001FFFFF*2^32 + 0xFFDF3B64
? 'this IEEE generate a carry into the INT(), and this succeeds to catch up bit 0 of the result;
 and then the result is incorrect'
? 'this show another thing: TRANSFORM use a different internal code'

nDummy=m.x*2^-32

? INT(m.nDummy),"BUG"
? TRANSFORM(m.nDummy,"@0") , "GOOD !!!!!!!"
? TRANSFORM(INT(m.nDummy),"@0") ,"BUG"
? BITOR(m.nDummy,0)		,"BUG"
Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform