Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add a big number
Message
From
30/07/2012 12:39:25
 
 
To
30/07/2012 12:16:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01549526
Message ID:
01549530
Views:
84
>I want to create a group of big number2, such as:
>
>123456789012345678901001
>123456789012345678901002
>123456789012345678901003
>
>
>I did
>
>nstart=123456789012345678901001
>cstart=alltrim(trans(nstart,'999999999999999999999999'))
>
>for i=1 to 10
>nstart=nstart+1
>cstart=cstart+'  '+alltrim(trans(nstart,'999999999999999999999999'))
>next
>
>
>but VFP can only add the first 16 digits
>thus I only get
>
>123456789012345678901001
>123456789012345600000000
>123456789012345600000000
>123456789012345600000000
>123456789012345600000000
>
>
>please advise
>
>Thank for the help
>
>Regards,
>
>Jerry


Shouldn't that difficult - create a class

For the mantissa, use an array - you can put 15 significant digits per element


UPDATE

14 significant digits per element

add a sign field

add methods for Add() and Sub()



If it's only for integers you're done, if not you'll have to add a field for the exponent and a method to normalize
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform