Loading src/com/android/calculator2/BoundedRational.java +3 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ package com.android.calculator2; import java.math.BigInteger; import com.hp.creals.CR; import com.hp.creals.AbortedError; public class BoundedRational { // TODO: Maybe eventually make this extend Number? Loading Loading @@ -386,7 +385,7 @@ public class BoundedRational { } BoundedRational tmp = pow(exp.shiftRight(1)); if (Thread.interrupted()) { throw new AbortedError(); throw new CR.AbortedException(); } return multiply(tmp, tmp); } Loading Loading @@ -453,11 +452,11 @@ public class BoundedRational { if (n > 4 * step) { BigInteger prod1 = genFactorial(n, 2 * step); if (Thread.interrupted()) { throw new AbortedError(); throw new CR.AbortedException(); } BigInteger prod2 = genFactorial(n - step, 2 * step); if (Thread.interrupted()) { throw new AbortedError(); throw new CR.AbortedException(); } return prod1.multiply(prod2); } else { Loading src/com/android/calculator2/Evaluator.java +5 −7 Original line number Diff line number Diff line Loading @@ -88,9 +88,7 @@ import android.os.Handler; import android.preference.PreferenceManager; import android.util.Log; import com.hp.creals.AbortedError; import com.hp.creals.CR; import com.hp.creals.PrecisionOverflowError; import java.io.DataInput; import java.io.DataOutput; Loading Loading @@ -233,9 +231,9 @@ class Evaluator { return new ReevalResult(mVal.toString(eval_prec), eval_prec); } catch(ArithmeticException e) { return null; } catch(PrecisionOverflowError e) { } catch(CR.PrecisionOverflowException e) { return null; } catch(AbortedError e) { } catch(CR.AbortedException e) { // Should only happen if the task was cancelled, // in which case we don't look at the result. return null; Loading @@ -252,7 +250,7 @@ class Evaluator { mCalculator.onError(R.string.error_nan); } else { if (result.mNewCacheDigs < mCacheDigs) { throw new Error("Unexpected onPostExecute timing"); throw new AssertionError("Unexpected onPostExecute timing"); } mCache = result.mNewCache; mCacheDigs = result.mNewCacheDigs; Loading Loading @@ -411,11 +409,11 @@ class Evaluator { return new InitialResult(R.string.error_zero_divide); } catch(ArithmeticException e) { return new InitialResult(R.string.error_nan); } catch(PrecisionOverflowError e) { } catch(CR.PrecisionOverflowException e) { // Extremely unlikely unless we're actually dividing by // zero or the like. return new InitialResult(R.string.error_overflow); } catch(AbortedError e) { } catch(CR.AbortedException e) { return new InitialResult(R.string.error_aborted); } } Loading Loading
src/com/android/calculator2/BoundedRational.java +3 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ package com.android.calculator2; import java.math.BigInteger; import com.hp.creals.CR; import com.hp.creals.AbortedError; public class BoundedRational { // TODO: Maybe eventually make this extend Number? Loading Loading @@ -386,7 +385,7 @@ public class BoundedRational { } BoundedRational tmp = pow(exp.shiftRight(1)); if (Thread.interrupted()) { throw new AbortedError(); throw new CR.AbortedException(); } return multiply(tmp, tmp); } Loading Loading @@ -453,11 +452,11 @@ public class BoundedRational { if (n > 4 * step) { BigInteger prod1 = genFactorial(n, 2 * step); if (Thread.interrupted()) { throw new AbortedError(); throw new CR.AbortedException(); } BigInteger prod2 = genFactorial(n - step, 2 * step); if (Thread.interrupted()) { throw new AbortedError(); throw new CR.AbortedException(); } return prod1.multiply(prod2); } else { Loading
src/com/android/calculator2/Evaluator.java +5 −7 Original line number Diff line number Diff line Loading @@ -88,9 +88,7 @@ import android.os.Handler; import android.preference.PreferenceManager; import android.util.Log; import com.hp.creals.AbortedError; import com.hp.creals.CR; import com.hp.creals.PrecisionOverflowError; import java.io.DataInput; import java.io.DataOutput; Loading Loading @@ -233,9 +231,9 @@ class Evaluator { return new ReevalResult(mVal.toString(eval_prec), eval_prec); } catch(ArithmeticException e) { return null; } catch(PrecisionOverflowError e) { } catch(CR.PrecisionOverflowException e) { return null; } catch(AbortedError e) { } catch(CR.AbortedException e) { // Should only happen if the task was cancelled, // in which case we don't look at the result. return null; Loading @@ -252,7 +250,7 @@ class Evaluator { mCalculator.onError(R.string.error_nan); } else { if (result.mNewCacheDigs < mCacheDigs) { throw new Error("Unexpected onPostExecute timing"); throw new AssertionError("Unexpected onPostExecute timing"); } mCache = result.mNewCache; mCacheDigs = result.mNewCacheDigs; Loading Loading @@ -411,11 +409,11 @@ class Evaluator { return new InitialResult(R.string.error_zero_divide); } catch(ArithmeticException e) { return new InitialResult(R.string.error_nan); } catch(PrecisionOverflowError e) { } catch(CR.PrecisionOverflowException e) { // Extremely unlikely unless we're actually dividing by // zero or the like. return new InitialResult(R.string.error_overflow); } catch(AbortedError e) { } catch(CR.AbortedException e) { return new InitialResult(R.string.error_aborted); } } Loading