[PATCH, libgfortran] PR68867 numeric formatting problem in the fortran library
Jerry DeLisle
jvdelisle@charter.net
Sun Dec 13 05:29:00 GMT 2015
On 12/12/2015 08:30 PM, Steve Kargl wrote:
> On Sat, Dec 12, 2015 at 08:14:39PM -0800, Jerry DeLisle wrote:
>> case 16:
>> + /* Adjust decimal precision depending on binary precision, 103 or 113. */
>
>
> s/103/106
Fixed the typo, thanks.
>
> I suspect that this is simply a bandaid on a much bigger
> problem. Namely, few of the intrinsic functions for
> REAL(16) expect 106 bits instead of 113 bits.
>
The patch only affects default "list directed" formatting which is processor
defined, ie defined by us. It seems obvious that the number of digits we emit
should be less. (It reminds me of the reports we get once in a while from people
wondering why 1.0_4/3.0_4 is not .333333333... out to 16 digits).
There are a few tests failing on PowerPC, not related to this PR, such as one of
the bessel tests. Also some of the ERF tests fail.
Otherwise the intrinsics I have spot checked are using GFC_REAL_16 to define
everything and that should be configured for PowerPC. I am not super familiar
with the architecture, but I assume it has its own specific math libraries.
For example, I see in one file:
#if defined(GFC_REAL_16_IS_FLOAT128)
#define MATHFUNC(funcname) funcname ## q
#else
#define MATHFUNC(funcname) funcname ## l
#endif
#if defined (HAVE_GFC_REAL_16)
Still looking for an OK.
Jerry
More information about the Fortran
mailing list