Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to obtain maximum numeric value ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00901754
Message ID:
00901763
Views:
19
Sylvain,

Check out the system capacities in the VFP HELP, just type "system capacities" in the index field,
then you should see:

Minimum value of an integer -2,147,483,647
Maximum value of an integer 2,147,483,647
Digits of precision in numeric computations
Visual FoxPro can handle numbers up to 9007199254740992 (2^53) in exact computations. 16
64 bits = 8 bytes
Largest number = 10 ^ 308 = 2 ^ 1023 -> 10 bits per
exponent + 1 for exp sign plus 1 for the number's sign => 12 bits.
Leaving 52 bits for the mantissa + 1 for implied normalized bit -> 53 bits
LOG10(2^53) = 15.95 decimal digits accuracy.

Hope this helps,

Dawa

>Hi,
>
>Is there a way to find out the maximum possible value of a numeric, float or double variable length field so that I can prevent a numeric overflow error ? That's in a web-based application so I can't bind the field to the control. It seems pretty simple at first but I haven't found a reliable way to do so.
>
>Thanks,
>Sylvain Bujold
>eMAINT Enterprises
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform