bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GMP Inputs


From: Hans Aberg
Subject: Re: GMP Inputs
Date: Tue, 1 May 2001 14:13:56 +0200

At 22:33 +0200 2001/04/25, Hans Aberg wrote:
>For the floating type, one would use logarithmic differentials dlog f :=
>>(df)/f, and for the fixed point type regular differentials. For example,
>>floating multiplication gives the new inaccuracy dlog(x*y) = dlog x + log
>y, >which is no worse than max(dlog x, log y), or the minimum precision of
>x and y.

If one plays on with this idea where the output precision is determined by
the precision of the arguments, then there this is this old convention that
when fixed and floating numbers are written (as strings), the number of
digits in the mantissa indicates the precision. So, for example, 1.0 and
1.00 are different because their precision differs. And, for example, 1.0 +
3.00 can be set to 4.0, whereas 1.00 + 3.00 must be set to at least the
precision of 4.00.

Funny things could happen, say if one uses fixed numbers for money, and
someone enters 1. + 0.23, for which it would be legal to return the result
1. However, it would be easy to set the precision of the arguments to at
least two decimals before adding them, in which case the result would be
1.23.

And in this variation, the output routines should always output trailing
zeroes as an indication of the actual precision used.

  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]