develooper Front page | perl.perl5.porters | Postings from December 2017

Re: [perl #132626] perl5 sprintf: wrong output on format %a

Thread Previous | Thread Next
December 20, 2017 12:45
Re: [perl #132626] perl5 sprintf: wrong output on format %a
Message ID:
Wolf-Dietrich Moeller wrote:
>print sprintf("%a  %f  %e  %g\n",30,30,30,30);
>0x1.ep+4  30.000000  3.000000e+001  30
>Line 1 shows the buggy result of "%a".

That looks correct to me.  What output were you expecting for %a?

>print sprintf("%a  %e  %f  %g\n",30,30,30,30);
>0x1.ep+4  0X1.EP+4  30.000000  30
>Line 2 shows that under certain combinations of format
>parameters the bug even extends to the next parameter.

There's certainly a bug there, with %e producing the wrong output.
Apparently that's triggered by coming immediately after %a.  But it
seems unlikely that this would have anything to do with whatever it is
that you perceive to be wrong about the output of %a.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About