gawk: MPFR features
1
1 15.3 Arbitrary-Precision Arithmetic Features in 'gawk'
1 ======================================================
1
1 By default, 'gawk' uses the double-precision floating-point values
1 supplied by the hardware of the system it runs on. However, if it was
1 compiled to do so, and the '-M' command-line option is supplied, 'gawk'
1 uses the GNU MPFR (http://www.mpfr.org) and GNU MP (https://gmplib.org)
1 (GMP) libraries for arbitrary-precision arithmetic on numbers. You can
1 see if MPFR support is available like so:
1
1 $ gawk --version
1 -| GNU Awk 4.1.2, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2)
1 -| Copyright (C) 1989, 1991-2015 Free Software Foundation.
1 ...
1
1 (You may see different version numbers than what's shown here. That's
1 OK; what's important is to see that GNU MPFR and GNU MP are listed in
1 the output.)
1
1 Additionally, there are a few elements available in the 'PROCINFO'
11 array to provide information about the MPFR and GMP libraries (⇒
Auto-set).
1
1 The MPFR library provides precise control over precisions and
1 rounding modes, and gives correctly rounded, reproducible,
1 platform-independent results. With the '-M' command-line option, all
1 floating-point arithmetic operators and numeric functions can yield
1 results to any desired precision level supported by MPFR.
1
1 Two predefined variables, 'PREC' and 'ROUNDMODE', provide control
1 over the working precision and the rounding mode. The precision and the
1 Setting precision:: and ⇒Setting the rounding mode for more
1 information.
1