Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to bitwise numbers that are greater than an integer?
Message
From
06/08/2003 07:44:51
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00817213
Message ID:
00817233
Views:
23
HI Tony,
X=0xFEDCBA98765418
? TRANSFORM(BITAND(X/4294967296,0xFFFFFFFF),'@0')+SUBSTR(TRANSFORM(BITAND(X,0xFFFFFFFF),'@0'),3)
but
X=0xFEDCBA9876541C
? TRANSFORM(BITAND(X/4294967296,0xFFFFFFFF),'@0')+SUBSTR(TRANSFORM(BITAND(X,0xFFFFFFFF),'@0'),3)
ATTENTION, fox know only float64 variables, x is a float64 (A double-precision floating-point number) with max integer 9007199254740992 (2^53)
x=9007199254740992
? TRANSFORM(BITAND(X/4294967296,0xFFFFFFFF),'@0')+SUBSTR(TRANSFORM(BITAND(X,0xFFFFFFFF),'@0'),3)
x=9007199254740992-1
? TRANSFORM(BITAND(X/4294967296,0xFFFFFFFF),'@0')+SUBSTR(TRANSFORM(BITAND(X,0xFFFFFFFF),'@0'),3)
is ok
but
x=9007199254740992+1
? TRANSFORM(BITAND(X/4294967296,0xFFFFFFFF),'@0')+SUBSTR(TRANSFORM(BITAND(X,0xFFFFFFFF),'@0'),3)
is not ok
Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform