[Top][All Lists]

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

Re: [bug-gawk] MPFR rounding issue

From: David Kaspar [Dee'Kej]
Subject: Re: [bug-gawk] MPFR rounding issue
Date: Tue, 21 Nov 2017 10:31:11 +0100

Thanks for jumping on this, guys. I also wasn't convinced that this is a bug, but I didn't want to sway you with my initial opinion. :)

The only difference is when the MPFR is used - it provides different result compared to when -M is not supplied. But again - you're using what the library returns. If you would update the documentation, that should be IMHO enough. :)

To answer your question, Andy, I think you're looking for this (from IEEE 754):

4.3.1 Rounding-direction attributes to nearest

― roundTiesToAway, the floating-point number nearest to the infinitely precise result shall be
delivered; if the two nearest floating-point numbers bracketing an unrepresentable infinitely
precise result are equally near, the one with larger magnitude shall be delivered.

For example, the GLIBC doesn't even have that mode for rounding, if I read it correctly. However, I guess it wouldn't hurt to use something like 'roundAwayFromZero', just as a derivative.

Best regards,

 -- Dee'Kej --

reply via email to

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