[libmath-prime-util-perl] 23/23: Work around broken 64-bit Perl 5.6.2

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:45:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.14
in repository libmath-prime-util-perl.

commit d6f41a62e5e9b902a305c9fe6e1431422d539893
Author: Dana Jacobsen <dana at acm.org>
Date:   Thu Nov 29 18:08:39 2012 -0800

    Work around broken 64-bit Perl 5.6.2
---
 lib/Math/Prime/Util/PP.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/Math/Prime/Util/PP.pm b/lib/Math/Prime/Util/PP.pm
index c105a13..253d15b 100644
--- a/lib/Math/Prime/Util/PP.pm
+++ b/lib/Math/Prime/Util/PP.pm
@@ -35,6 +35,9 @@ my $_half_word = (~0 == 18446744073709551615) ? 4294967296 :    # 64-bit
                  (~0 ==           4294967295) ?      65536 :    # 32-bit
                  (~0 ==                   -1) ?   1000**10 :    # bignum
                                                          0 ;    # No idea
+# With Perl 5.6.2, (114438327*114438327) % 122164969  !=  75730585
+$_half_word >>= 7 if $_uv_size == 64 && $] < 5.008;
+
 # Infinity in Perl is rather O/S specific.
 our $_Infinity = 0+'inf';
 $_Infinity = 20**20**20 if 65535 > $_Infinity;   # E.g. Windows
@@ -612,6 +615,7 @@ sub _mulmod {
   $r;
 }
 
+# Note that Perl 5.6.2 with largish 64-bit numbers will break.  As usual.
 sub _native_powmod {
   my($n, $power, $m) = @_;
   my $t = 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list