summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/math/BigDecimalTest.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/junit/scala/math/BigDecimalTest.scala b/test/junit/scala/math/BigDecimalTest.scala
index c7a63da890..dedf2e242e 100644
--- a/test/junit/scala/math/BigDecimalTest.scala
+++ b/test/junit/scala/math/BigDecimalTest.scala
@@ -228,4 +228,11 @@ class BigDecimalTest {
def test_SI8970() {
assert((0.1).## == BigDecimal(0.1).##)
}
+
+ // Motivated by the problem of MathContext lost
+ @Test
+ def testMathContext() {
+ assert(BigDecimal(1.1d, MC.UNLIMITED).pow(1000) == BigDecimal("1.1", MC.UNLIMITED).pow(1000))
+ assert((BigDecimal(1.23d, new MC(3)) + BigDecimal("0.005")).rounded == BigDecimal("1.24"))
+ }
}