Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding large numbers
Message
De
13/09/2013 04:01:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01582980
Message ID:
01583114
Vues:
58
>I realized the calculation must be done using character strings instead of numbers. I found the code on Tek-Tips, which gives the correct result:

Looks like something I did back in the 80s (when I was trying to calculate e to 600 digits). It's OK as a method, except the speed. My method was to chop it into smaller pieces and stuff them into an array, 6 digits at a time, although with IEEE number I can probably even do multiplication with 7 without overflow. So I'd do an operation on a pair of elements of two arrays and stuff into the corresponding element of the third array, take the carry to the next element and so on. The end result was converted back into a string. Used to be reasonably fast even on a Spectrum with a 1.7MHz z80.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform