diff options
| author | 2016-02-25 20:26:31 +0000 | |
|---|---|---|
| committer | 2016-02-25 20:26:31 +0000 | |
| commit | 6d174eebe711d52d59df04890375d3f67bc5682e (patch) | |
| tree | 407a7b3d0b701620c1fe1728ac9ab311e6e83ab3 | |
| parent | 9ec486cc08ad658eee33f9bde405b97502562840 (diff) | |
| parent | 9c1c06ad57937f0f3add3779cc46e597cb76803a (diff) | |
Merge "Add StrictMath.round tests for large integers."
| -rw-r--r-- | test/082-inline-execute/src/Main.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/082-inline-execute/src/Main.java b/test/082-inline-execute/src/Main.java index 5b3fa14076..93a9005fe0 100644 --- a/test/082-inline-execute/src/Main.java +++ b/test/082-inline-execute/src/Main.java @@ -1039,6 +1039,7 @@ public class Main { Assert.assertEquals(StrictMath.round(-2.9d), -3l); Assert.assertEquals(StrictMath.round(-3.0d), -3l); Assert.assertEquals(StrictMath.round(0.49999999999999994d), 0l); + Assert.assertEquals(StrictMath.round(9007199254740991.0d), 9007199254740991l); // 2^53 - 1 Assert.assertEquals(StrictMath.round(Double.NaN), (long)+0.0d); Assert.assertEquals(StrictMath.round(Long.MAX_VALUE + 1.0d), Long.MAX_VALUE); Assert.assertEquals(StrictMath.round(Long.MIN_VALUE - 1.0d), Long.MIN_VALUE); @@ -1062,6 +1063,7 @@ public class Main { Assert.assertEquals(StrictMath.round(-3.0f), -3); // 0.4999999701976776123046875 Assert.assertEquals(StrictMath.round(Float.intBitsToFloat(0x3EFFFFFF)), (int)+0.0f); + Assert.assertEquals(StrictMath.round(16777215.0f), 16777215); // 2^24 - 1 Assert.assertEquals(StrictMath.round(Float.NaN), (int)+0.0f); Assert.assertEquals(StrictMath.round(Integer.MAX_VALUE + 1.0f), Integer.MAX_VALUE); Assert.assertEquals(StrictMath.round(Integer.MIN_VALUE - 1.0f), Integer.MIN_VALUE); |