summaryrefslogtreecommitdiffstats
path: root/src/com/android/calculator2/BoundedRational.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/calculator2/BoundedRational.java')
-rw-r--r--src/com/android/calculator2/BoundedRational.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/calculator2/BoundedRational.java b/src/com/android/calculator2/BoundedRational.java
index 9d3e2a7..dc132f6 100644
--- a/src/com/android/calculator2/BoundedRational.java
+++ b/src/com/android/calculator2/BoundedRational.java
@@ -555,6 +555,9 @@ public class BoundedRational {
}
return prod1.multiply(prod2);
} else {
+ if (n == 0) {
+ return BigInteger.ONE;
+ }
BigInteger res = BigInteger.valueOf(n);
for (long i = n - step; i > 1; i -= step) {
res = res.multiply(BigInteger.valueOf(i));