Hilmar,
>What does the second example do - the one with the empty operator?
It makes addition. "+" is everywhere by default, so it may be skipped.
>I would suggest the following enhancements:
>1) Extend the concept to multiplication and division. The algorithm is more >complicated, of course, than addition or subtraction, and the calculations >would be slow if you multiply, say, two 500-digit numbers. Ask me if you need >details on the algorithm. The basic idea, of course, is to apply the >multiplication algorithm you learned in primary school. Intermediate results >have to be stored - and incremented - in arrays or something similar.
It seems you already did it. If so, did you post it somewhere? I would not post my ymore16 if I saw something similar.
>2) Instead of limiting to 16 decimals digits, you might provide an (optional) >parameter for the number of digits in the result. Let's say that the default >remains at 16 - this would seem a reasonable default to me. I mean, if you >scan a text one byte at a time, there is no need to arbitrarily limit the >input and the results to 16 decimals.
Actually I am doubting that calculations with precision more than 16 will be useful. Just current situation with economy/monetary system in some countries forces to extend the precision limit.
Thank you for your replay.
Yuri
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement