Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BitAnd() limitation?
Message
From
12/08/2004 12:46:41
 
 
To
12/08/2004 11:56:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00931430
Message ID:
00932807
Views:
25
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 stop 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
Previous
Reply
Map
View

Click here to load this message in the networking platform