From de1dbcaa3acc1fb2d29c2fe048843ca5f014a2db Mon Sep 17 00:00:00 2001
From: Solomon Foster <colomon@gmail.com>
Date: Tue, 1 Sep 2009 10:36:03 -0400
Subject: [PATCH] Apply moritz's patch to infix:<div> for Ints. Patch makes it behave correctly
 with "floor" behavior, but fails tests on very large Ints.

---
 src/setting/Int.pm |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/setting/Int.pm b/src/setting/Int.pm
index 864e551..2962758 100644
--- a/src/setting/Int.pm
+++ b/src/setting/Int.pm
@@ -52,18 +52,11 @@ multi sub infix:<*>(Int $a, Int $b) {
 multi sub infix:<div>(Int $a, Int $b) {
     Q:PIR {
         $P0 = find_lex '$a'
-        $N0 = $P0
+        $I0 = $P0
         $P1 = find_lex '$b'
-        $N1 = $P1
-        $N2 = $N0 / $N1
-        $I2 = floor $N2
-        $N3 = $N2 - $I2
-      if $N3 != 0 goto notint
-        %r = '!upgrade_to_num_if_needed'($N2)
-        goto done
-      notint:
-        %r = box $N2
-      done:
+        $I1 = $P1
+        $I2 = $I0 / $I1
+        %r = box $I2
     }
 }
 
-- 
1.6.0.5

