New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sprintf: %f rounding different in 5.24.0 and 5.26.0 #15997
Comments
From wolf-dietrich_moeller@t-online.deHi, For Perl 5.24 the result is while for Perl 5.26 the result is Tested with downloaded strawberry perl versions on WinXP SP3: Is this change intended? This makes comparisons with old results very hard. Best regards |
From @TuxOn Sun, 04 Jun 2017 02:40:44 -0700, Wolf-Dietrich Moeller (via RT)
on a Linux system I get consistent 44.62 for all 270 installed perl $ perl-all -e'my same result for print sprintf -- |
The RT System itself - Status changed from 'new' to 'open' |
From @shlomifHi Wolf! On Sun, 04 Jun 2017 02:40:44 -0700
On x86-64 Linux with perl-5.24.1 and perl-5.26.0 built using perlbrew I am
-- Shlomi Fish http://www.shlomifish.org/ |
From @jkeenanOn Sun, 04 Jun 2017 09:40:44 GMT, wolf-dietrich_moeller@t-online.de wrote:
I suspect your change is platform-specific. Here's what I get on FreeBSD-10.3: ##### [perl] $ perl -e 'my $x=44.625;print sprintf("%.2f %.25f\n",$x,$x);' [perl] $ ./perl -v | head -2 | tail -1 [perl] $ ./perl -e 'my $x=44.625;print sprintf("%.2f %.25f\n",$x,$x);' Thank you very much. |
From @sisyphus
perl-5.26.0 is the first 32-bit Strawberry Perl to have been built For my own 32-bit Windows builds of perl-5.26.0 (also built C:\_32>perl -le "printf '%.2f', 44.625;" But the error re-appears when I build perl-5.26.0 without defining that C:\_32>\temp\bin\perl -le "printf '%.2f', 44.625;" You'll find that there are other (s)printf corrections attributable Cheers, |
From @tonycozOn Sun, 04 Jun 2017 06:42:39 -0700, sisyphus wrote:
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 |
From @sisyphusYes - please feel free to close it. Both win32/GNUmakefile and win32/makefile.mk now accommodate the defining Cheers, On Mon, Jan 7, 2019 at 2:08 PM Tony Cook via RT <perlbug-followup@perl.org>
|
From @tonycozOn Sun, 06 Jan 2019 20:38:45 -0800, sisyphus359@gmail.com wrote:
Thanks, closing.
Are there any negatives to defining it? Tony |
@tonycoz - Status changed from 'open' to 'rejected' |
From @tonycozOn Mon, 07 Jan 2019 14:04:45 -0800, tonyc wrote:
And should they instead define _GNU_SOURCE? https://rt-archive.perl.org/perl5/Ticket/Display.html?id=130447#txn-1461711 https://gmplib.org/list-archives/gmp-bugs/2017-May/004162.html Tony |
From @sisyphusThe only negative I've come across is the one expressed here by the OP - I've not tried defining _GNU_SOURCE. I've instead always defined Attached are patches to win32/GNUmakefile and win32/makefile.mk, that make Cheers, On Tue, Jan 8, 2019 at 10:25 AM Tony Cook via RT <perlbug-followup@perl.org>
|
From @sisyphus0001-Make-D__USE_MINGW_ANSI_STDIO-Win32-default.patchFrom 74f9a9a754261e0bdebb9e8a33838024a48ab108 Mon Sep 17 00:00:00 2001
From: sisyphus <sisyphus@cpan.org>
Date: Tue, 8 Jan 2019 17:23:42 +1100
Subject: [PATCH 1/2] Make -D__USE_MINGW_ANSI_STDIO Win32 default
---
win32/GNUmakefile | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index 8aa1fc5..a9ebb53 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -137,12 +137,15 @@ USE_LARGE_FILES := define
#USE_LONG_DOUBLE := define
#
-# Uncomment this if you want to build perl with __USE_MINGW_ANSI_STDIO defined.
-# (If you're building perl with USE_LONG_DOUBLE defined then
-# __USE_MINGW_ANSI_STDIO will be defined whether or not this is uncommented.)
-# This option is not supported for MSVC builds.
+# Comment this out if you want to build perl without __USE_MINGW_ANSI_STDIO
+# defined.
+# For GCC builds, if you're building perl with USE_LONG_DOUBLE defined then
+# __USE_MINGW_ANSI_STDIO will be defined, irrespective of whether or not this
+# is uncommented.
+# For MSVC builds, __USE_MINGW_ANSI_STDIO will NOT be defined, irrespective of
+# whether or not this is uncommented.
#
-#USE_MINGW_ANSI_STDIO := define
+USE_MINGW_ANSI_STDIO := define
#
# Comment this out if you want the legacy default behavior of including '.' at
@@ -455,10 +458,11 @@ ifeq ($(CCTYPE),MSVC60)
USE_64_BIT_INT = undef
endif
-# Disable the long double option for MSVC builds since that compiler
-# does not support it.
+# Disable both the USE_LONG_DOUBLE and USE_MINGW_ANSI_STDIO options for MSVC
+# builds since that compiler does not support those options.
ifneq ($(CCTYPE),GCC)
USE_LONG_DOUBLE = undef
+USE_MINGW_ANSI_STDIO = undef
endif
ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
--
2.1.4
|
From @sisyphus0002-Make-D__USE_MINGW_ANSI_STDIO-Win32-default.patchFrom 76cb4879827c4b792fef31dcddb2c70c23921994 Mon Sep 17 00:00:00 2001
From: sisyphus <sisyphus@cpan.org>
Date: Tue, 8 Jan 2019 17:24:03 +1100
Subject: [PATCH 2/2] Make -D__USE_MINGW_ANSI_STDIO Win32 default
---
win32/makefile.mk | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 267099f..e013bb7 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -109,12 +109,15 @@ USE_LARGE_FILES *= define
#USE_LONG_DOUBLE *= define
#
-# Uncomment this if you want to build perl with __USE_MINGW_ANSI_STDIO defined.
-# (If you're building perl with USE_LONG_DOUBLE defined then
-# __USE_MINGW_ANSI_STDIO will be defined whether or not this is uncommented.)
-# This option is not supported for MSVC builds.
+# Comment this out if you want to build perl without __USE_MINGW_ANSI_STDIO
+# defined.
+# For GCC builds, if you're building perl with USE_LONG_DOUBLE defined then
+# __USE_MINGW_ANSI_STDIO will be defined, irrespective of whether or not this
+# is uncommented.
+# For MSVC builds, __USE_MINGW_ANSI_STDIO will NOT be defined, irrespective of
+# whether or not this is uncommented.
#
-#USE_MINGW_ANSI_STDIO *= define
+USE_MINGW_ANSI_STDIO *= define
#
# Comment this out if you want the legacy default behavior of including '.' at
@@ -440,10 +443,11 @@ CCTYPE = SDK2003SP1
USE_64_BIT_INT != undef
.ENDIF
-# Disable the long double option for MSVC builds since that compiler
-# does not support it.
+# Disable both the USE_LONG_DOUBLE and USE_MINGW_ANSI_STDIO options for MSVC
+# builds since that compiler does not support those options.
.IF "$(CCTYPE)" != "GCC"
USE_LONG_DOUBLE != undef
+USE_MINGW_ANSI_STDIO != undef
.ENDIF
ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
--
2.1.4
|
Migrated from rt.perl.org#131506 (status was 'rejected')
Searchable as RT131506$
The text was updated successfully, but these errors were encountered: