Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Whole numbers
Message
From
26/01/2000 10:06:20
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00322702
Message ID:
00322787
Views:
24
>>>>a=123456789012345678
>>>>? a
>>>>result is :
>>>>123456789012345700
>>>>why or how can i see the true result?
>>>
>>>SET DECIMALS may help, but there is a limit to the precision of a number. Numbers of this magnitude are stored as floating point values and are intherently subject to rounding errors because they are not integer representations. You don't have 18 digits of precision, since this is going to be stored as a floating point number. And in all probability, and in all probability, unless you are computing astronomical distances, you don't have a real requirement of 18 digit precision. And if you do, you want a language with something bigger than the available float representations in VFP. The way the number is stored, it probably can't resolve the units in the least significant digit position accurately.
>>>
>>>FORTRAN or one of the other scientific/mathematical languages, or LISP, would be far more appropriate for this type of precision, and would offer stronger numerical support.
>>
>>Thanks Ed:
>>The problem is that inflation is very high in turkey.
>>1 dollar is 550,000 Turkish liras.
>
>18 decimal places is 2 * 10^12 dollars. Thousand = 10^3, million = 10^6, billion (with a B) = 10^9. You're talking about two trillion dollars. If you're doing currency calculations that require sums this large that tie out to the nearest whole Turkish lira, you need a 19 decimal place signed BCD (10 byte long packed BCD) with no accuracy below the units position. COBOL or a similar business language with a packed BCD representation would be appropriate here. And if you have to do any multiplication or division, it needs to be bigger.
>
>VFP is not suitable for all things.

Thanks Ed;
Today.About 2 trilion dollars.
But what to do after 3 years?
Inflation is very high.
And i have ask this question for a friend.He is working for government.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform