Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
July letter on MSDN VFP web site
Message
From
19/07/2004 10:05:14
 
 
To
19/07/2004 08:53:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00925465
Message ID:
00925749
Views:
22
Dale,

The max number you can store in a x digit decimal is 10^(x)-1
1 digit decimal: 10^1-1=9
1 digit hexadecimal: 16^1-1=F (15)
1 digit binary: 2^1-1=1 (1)
2 digit binary: 2^2-1=3 (11)
2 digit binary: 2^3-1=7 (111)
..
8 digit binary: 2^8-1=255 (1111 1111)
32 digit binary: 2^32-1=4294967295 (1111 1111 1111 1111 1111 1111 1111 1111)

since intergers can be signed the left most digit is ised fo the sing therefore:
32 digit signed binary: 2^31-1=2147483647 (s111 1111 1111 1111 1111 1111 1111 1111) which is the max numnber you can store in an integer data field.

Hope this clears up you confusion <s>

Peter

>0 thru 31=32
>
>>There're 32 bits not 31. To be presize, the max value stored in 32 bits is 2^32-1. See UINT_MAX at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/class_34.asp.
>>
>>>
>>>2^0=1
>>>2^1=2
>>>2^2=4
>>>2^3=8
>>>2^4=16
>>>2^5=32
>>>2^6=64
>>>2^7=128
>>>2^8=256
>>>2^9=512
>>>2^10=1024
>>>2^11=2048
>>>2^12=4096
>>>2^13=8192
>>>2^14=16384
>>>2^15=32768
>>>2^16=65536
>>>2^17=131072
>>>2^18=262144
>>>2^19=524288
>>>2^20=1048576
>>>2^21=2097152
>>>2^22=4194304
>>>2^23=8388608
>>>2^24=16777216
>>>2^25=33554432
>>>2^26=67108864
>>>2^27=134217728
>>>2^28=268435456
>>>2^29=536870912
>>>2^30=1073741824
>>>2^31=2147483648
>>>__________
>>>3,221,225,472 (Total of all 1's)
>>>
Peter Cortiel
Previous
Reply
Map
View

Click here to load this message in the networking platform