Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Whole numbers
Message
From
26/01/2000 10:41:05
 
 
To
26/01/2000 10:06:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00322702
Message ID:
00322822
Views:
21
>>>>>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?

Be very glad he started moving his app this afternoon to a platform that did not have this problem 3 years before it killed him! IOW, waiting until it smacks him like a ton of bricks, like the few unfortunates who decided they needed to plan for Y2K just before leaving for the New Year's Eve party, does not seem best. He knows he has a problem. It is not a problem now. We know it will be at some point in the future. Fix it before you lose data and have no breathing room. He needs to research now what platform will give him the options to deal with numbers 3 or 4 orders of magnitude bigger than the VFP currency field. We know the answer is not VFP6, and waiting to see if VFP7 might do it is downright dumb. Find the right way to fix it NOW!

>Inflation is very high.
>And i have ask this question for a friend.He is working for government.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform