develooper Front page | perl.perl5.porters | Postings from January 2019

[perl #131506] sprintf: %f rounding different in 5.24.0 and 5.26.0

Thread Next
From:
Tony Cook via RT
Date:
January 7, 2019 03:08
Subject:
[perl #131506] sprintf: %f rounding different in 5.24.0 and 5.26.0
Message ID:
rt-4.0.24-28919-1546830498-1197.131506-15-0@perl.org
On Sun, 04 Jun 2017 06:42:39 -0700, sisyphus wrote:
> 
> > when comparing output generated with Perl 5.24.0 and 5.26.0, I found
> > the
> > following difference for the test program
> > #############
> > my $x=44.625;print sprintf('%.2f  %.25f',$x,$x);
> > #############
> >
> > For Perl 5.24 the result is
> > 44.63  44.6250000000000000000000000
> >
> > while for Perl 5.26 the result is
> > 44.62  44.6250000000000000000000000
> 
> perl-5.26.0 is the first 32-bit Strawberry Perl to have been built
> with -D__USE_MINGW_ANSI_STDIO and it's seemingly the defining of this
> symbol
> that has fixed the error you've been seeing in perl-5.24.x and
> earlier.
> 
> For my own 32-bit Windows builds of perl-5.26.0 (also built
> with -D__USE_MINGW_ANSI_STDIO) I'm also getting:

If I understand correctly, this is a Strawberry perl specific issue rather than core perl itself?

Is that right?

If so this ticket can be closed.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=131506

Thread Next


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