help-gawk
[Top][All Lists]
Advanced

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

Re: Support of log10? (Peng Yu)


From: J Naman
Subject: Re: Support of log10? (Peng Yu)
Date: Sun, 15 Aug 2021 12:35:27 -0400

I think that you may find your answer in
*Chap 16 Arithmeticand Arbitrary-Precision Arithmetic*, which is a feature
available only in gawk. The default precision of Float doubles
is 53 bits (15 decimal places). If that causes you problems for log(10),
then you have the same problem everywhere in your code that you use
floating point arithmetic.
I have used PREC=118 up to 500 bits for testing some algorithms.
However, you *MUST *use the *Gawk -M command-line option *to use
the GNU MPFR and GNU MP (GMP) libraries for arbitrary
precision arithmetic on numbers.
Two predefined variables, PREC and ROUNDMODE, provide
control over the working precision and the rounding mode.
The precision and the rounding mode are set globally for
every operation to follow.
See Section 16.4.4 [Setting the Precision], page 374,
and Section 16.4.5 [Setting the Rounding Mode], page 375,
for more information.


reply via email to

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