Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
As Client Budget limit to $225179981368.5286
Message
De
29/04/2003 12:10:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
29/04/2003 11:42:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00782748
Message ID:
00782769
Vues:
13
Unfortunately, each numeric data type has its own limits, and this must always be considered when you work with very large (or very small) numbers. For currency data, type "Currency" permits more significant digits.

Do you have a real problem for you now, for which you want assistance, or are you just experimenting what the limits are?

In any case, I made a download available, "math unlimited", which permits calculations with hundreds or thousands of digits. It uses VFP code, and supports addition, subtraction, multiplication, division, trigonometric functions, and several functions more. Due to the way it works, it is much slower than working with the built-in data types. I published it mainly because I found the question interesting, but I don't believe that my class has much practical value.

Some libraries (DLL?) can be obtained for free, for the same purpuse. If they are compiled in "C", for instance, they should work much faster.

>Hi
>
>the numeric variable data support only double type.
>
>Result: many Currency >=$225179981368.5286 can be calculate to you in wrong way.
>
>Attention to develop programs for customers with many moneies !!!
>
>A short test program in order to amuse to you:
>
>STORE NTOM(VAL(INPUTBOX("min value","Input", "225179981368.0000" ))) TO nMin
>STORE NTOM(m.nMin+VAL(INPUTBOX("interval" ,"Input", "1.0000"))) TO nMax
>
>LOCAL notEqual
>
>?' Range : ',m.nMin,' To ',m.nMax
>?'----------------------------------------------'
>?' Start = : ',m.nMin
>sEscape=SET("Escape")
>SET ESCAPE ON
>n=m.nMin
>DO WHILE m.n<=m.nMax
> IF (NTOM(MTON((m.n)))=m.n)=m.notEqual
> IF m.notEqual
> ? ' Start = : ',m.n
> ELSE
> ? ' Start # : ',m.n,TRANSFORM(NTOM(MTON((m.n)))-m.n)
> ENDIF
> STORE !m.notEqual TO notEqual
> ENDIF
> DOEVENTS
> STORE m.n+$0.0001 TO n
>ENDDO
>SET ESCAPE &sEscape
>?'----------------------------------------------'
>RETURN
>
>
>Fabio
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform