bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] inside awk script check that -M/--bignum given on command


From: Jannick
Subject: Re: [bug-gawk] inside awk script check that -M/--bignum given on command line?
Date: Fri, 5 Jan 2018 03:54:13 +0100

Hi Andy,

On Thu, 4 Jan 2018 21:16:02 -0500, Andrew J. Schorr wrote:
> On Fri, Jan 05, 2018 at 03:04:01AM +0100, Jannick wrote:
> > I quickly checked the code above which does the job after decreasing
> > fpbits to 53.
> 
> If you decrease fpbits to 53, then you're not actually testing for MPFR,
since
> standard double-precision floating-point gives you 53 bits of precision.

> I am running on Linux with MPFR 3.1.1 and GMP 6.0.0, and gawk -M works
> fine for me. Why do you need to update?

> How many bits of precision does your program need to run correctly?
> That should be the value of fpbits.

Good point, thanks. My program needs 30 bits of precision, so I am more than
on the safe side here and no update circus needed. Great!

May I mention two tiny things for the manual which, of course, I will leave
with you if you want to add that to the gawk documentation in some form:

1 - 'exit 1' (as given in the BEGIN section of the example code you were
quoting earlier from the gawk manual) is not an immediate exit, but it makes
gawk jump to the END section which it then bravely works through and exits
then (cf. 7.4.10 gawk manual, ed. 4.2). I know that this is really
nitty-gritty, but I thought I mention that as a tiny contribution, since
other users might wonder why a larger script with a huge END section does
not immediately exit if the MPFR test fails.
2 - The exact fpbits number in the example code is not really written in
stone as such. While  the upper bound of fpbits depends on the machine the
script is run on, it might well be OK to solve the problem with the lower
precision (so my issue I got trapped in). 

> Regards,
> Andy

Very much appreciated your help!

Regards,
J.





reply via email to

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