diff options
author | Hans Boehm <hboehm@google.com> | 2015-10-10 00:18:42 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-10 00:18:42 +0000 |
commit | d6136e699d360e920cd11036056b62a1923e4166 (patch) | |
tree | 4a853012588fb95be9221aa55abf4333561cc84f /tests/src/com/android/calculator2/BRTest.java | |
parent | 1a78db27efd1814e00b3a1af620a3a6900f60287 (diff) | |
parent | ca9a5ad0d46acb1e69730b06dd9716349a781bff (diff) | |
download | android_packages_apps_ExactCalculator-d6136e699d360e920cd11036056b62a1923e4166.tar.gz android_packages_apps_ExactCalculator-d6136e699d360e920cd11036056b62a1923e4166.tar.bz2 android_packages_apps_ExactCalculator-d6136e699d360e920cd11036056b62a1923e4166.zip |
am ca9a5ad0: am 114e08db: Merge "BoundedRational.java cleanup" into mnc-dr-dev
* commit 'ca9a5ad0d46acb1e69730b06dd9716349a781bff':
BoundedRational.java cleanup
Diffstat (limited to 'tests/src/com/android/calculator2/BRTest.java')
-rw-r--r-- | tests/src/com/android/calculator2/BRTest.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/src/com/android/calculator2/BRTest.java b/tests/src/com/android/calculator2/BRTest.java index 77d4bf0..0163a0f 100644 --- a/tests/src/com/android/calculator2/BRTest.java +++ b/tests/src/com/android/calculator2/BRTest.java @@ -139,6 +139,12 @@ public class BRTest extends TestCase { check(BR_0.signum() == 0, "signum(0)"); check(BR_M1.signum() == -1, "signum(-1)"); check(BR_2.signum() == 1, "signum(2)"); + check(BoundedRational.asBigInteger(BR_390).intValue() == 390, "390.asBigInteger()"); + check(BoundedRational.asBigInteger(BoundedRational.HALF) == null, "1/2.asBigInteger()"); + check(BoundedRational.asBigInteger(BoundedRational.MINUS_HALF) == null, + "-1/2.asBigInteger()"); + check(BoundedRational.asBigInteger(new BoundedRational(15, -5)).intValue() == -3, + "-15/5.asBigInteger()"); check(BoundedRational.digitsRequired(BoundedRational.ZERO) == 0, "digitsRequired(0)"); check(BoundedRational.digitsRequired(BoundedRational.HALF) == 1, "digitsRequired(1/2)"); check(BoundedRational.digitsRequired(BoundedRational.MINUS_HALF) == 1, |