https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98384

--- Comment #24 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to David Edelsohn from comment #23)
> The AIX failure is:
> 
> printf_buffer=
> 1.
> 44269504088896338700465094007086008800000000000000000000000000000000000000000
> 00000000000000000000000 
> 
> to_chars_buffer=
> 1.
> 44269504088896338700465094007086008787155151367187500000000000000000000000000
> 00000000000000000000000??/?P00001.
> 44269504088896338700465094007086008800000000000000000000000000000000000000000
> 00000000000000000000000
> 
> output_length=
> 102
> 
> ./long_double.cc:194: void test02(): Assertion '!memcmp(printf_buffer,
> to_chars_buffer, output_length)' failed.

I managed to reproduce this issue on AIX (gcc119).  It looks like the %e/%f/%g
specifiers (as well as %Le/%Lf/%Lg -- long double is equivalent to double)
never output more than 37 significant decimal digits on AIX.

For e.g.

  printf("%.53e\n", 0x1.71547652b82fep+0);
  printf("%.0f\n", 0x1.249ad2594c37dp+332);

x86 glibc printf outputs

  1.44269504088896338700465094007086008787155151367187500e+00
 
10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104

and AIX printf outputs

  1.44269504088896338700465094007086008800000000000000000e+00
 
10000000000000000159028911097599180470000000000000000000000000000000000000000000000000000000000000000

It seems to me the output of AIX printf is wrong/nonconforming here..

Reply via email to