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

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

Thread Previous
From:
Zefram
Date:
December 20, 2017 13:08
Subject:
Re: [perl #132626] perl5 sprintf: wrong output on format %a
Message ID:
20171220130803.GA25404@fysh.org
I wrote:
>Wolf-Dietrich Moeller wrote:
>>print sprintf("%a  %e  %f  %g\n",30,30,30,30);
>>0x1.ep+4  0X1.EP+4  30.000000  30
>
>There's certainly a bug there, with %e producing the wrong output.

This was fixed by commit 5d10f2fcfe8b2a11672351b95a7f374075dd4c67 in
Perl 5.27.1.

$ perl5.27.1 -we 'print sprintf("%a  %e  %f  %g\n",30,30,30,30)'
0x1.ep+4  3.000000e+01  30.000000  30

-zefram

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About