diff options
author | clhodapp <clhodapp1@gmail.com> | 2014-01-05 21:38:26 -0600 |
---|---|---|
committer | clhodapp <clhodapp1@gmail.com> | 2014-01-06 13:07:30 -0600 |
commit | b46d7aefd6eda36454cfd4cf339642e3c13c2022 (patch) | |
tree | 9359cafc6697ee0d7343b8ca3c6d19c1714dba21 /test/junit | |
parent | 527fd9aea58cf5c1b8f638d0321a8d0947d2916a (diff) | |
download | scala-b46d7aefd6eda36454cfd4cf339642e3c13c2022.tar.gz scala-b46d7aefd6eda36454cfd4cf339642e3c13c2022.tar.bz2 scala-b46d7aefd6eda36454cfd4cf339642e3c13c2022.zip |
SI-8102 -0.0.abs must equal 0.0
SI-8102 points out that -0.0.abs returns -0.0 (in error). The same issue
exists for -0.0f. This commit fixes the issue for both by delegating to
math.abs.
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/math/NumericTest.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/junit/scala/math/NumericTest.scala b/test/junit/scala/math/NumericTest.scala new file mode 100644 index 0000000000..4f0657f471 --- /dev/null +++ b/test/junit/scala/math/NumericTest.scala @@ -0,0 +1,18 @@ + + +import org.junit.Assert._ +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +@RunWith(classOf[JUnit4]) +class NumericTest { + + /* Test for SI-8102 */ + @Test + def testAbs { + assertTrue(-0.0.abs equals 0.0) + assertTrue(-0.0f.abs equals 0.0f) + } +} + |