Blob Blame History Raw
From 171a485549630889c27e240dc7d341378e5435b4 Mon Sep 17 00:00:00 2001
From: Karel Miko <karel.miko@gmail.com>
Date: Thu, 22 Nov 2018 11:34:51 +0100
Subject: [PATCH] HACK: needed for MBI 1.999715 compatibility
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 lib/Math/BigInt/LTM.pm | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/Math/BigInt/LTM.pm b/lib/Math/BigInt/LTM.pm
index 4ee7bb78..dfe6b677 100644
--- a/lib/Math/BigInt/LTM.pm
+++ b/lib/Math/BigInt/LTM.pm
@@ -331,7 +331,7 @@ sub _num {
     0 + $class -> _str($x);
 }
 
-### same as _fac() in Math::BigInt::Lib
+### PATCHED _fac() from Math::BigInt::Lib
 sub _fac {
     # factorial
     my ($class, $x) = @_;
@@ -339,7 +339,9 @@ sub _fac {
     my $two = $class -> _two();
 
     if ($class -> _acmp($x, $two) < 0) {
-        return $class -> _one();
+        ###HACK: needed for MBI 1.999715 compatibility
+        ###return $class -> _one();
+        $class->_set($x, 1); return $x
     }
 
     my $i = $class -> _copy($x);
@@ -351,7 +353,7 @@ sub _fac {
     return $x;
 }
 
-### same as _dfac() in Math::BigInt::Lib
+### PATCHED _dfac() from Math::BigInt::Lib
 sub _dfac {
     # double factorial
     my ($class, $x) = @_;
@@ -359,7 +361,9 @@ sub _dfac {
     my $two = $class -> _two();
 
     if ($class -> _acmp($x, $two) < 0) {
-        return $class -> _one();
+        ###HACK: needed for MBI 1.999715 compatibility
+        ###return $class -> _one();
+        $class->_set($x, 1); return $x
     }
 
     my $i = $class -> _copy($x);
-- 
2.17.2