diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/bigints.check | 9 | ||||
-rw-r--r-- | test/files/jvm/bigints.scala | 35 |
2 files changed, 39 insertions, 5 deletions
diff --git a/test/files/jvm/bigints.check b/test/files/jvm/bigints.check index fb50db6447..3e67ff1255 100644 --- a/test/files/jvm/bigints.check +++ b/test/files/jvm/bigints.check @@ -3,3 +3,12 @@ true false true true + +3 +true +false +true +true +9223372036854775806 +false +true diff --git a/test/files/jvm/bigints.scala b/test/files/jvm/bigints.scala index 627c81cbfc..2bba345663 100644 --- a/test/files/jvm/bigints.scala +++ b/test/files/jvm/bigints.scala @@ -1,13 +1,38 @@ object Test extends Application { + Test1 + Test2 +} + +object Test1 { import BigInt._ val x: BigInt = 1 val y = x + 1 val z = 1 + y - Console.println(z) - Console.println(z <= 3) - Console.println(3 < z) - Console.println(z == 3) - Console.println(3 == z) + println(z) + println(z <= 3) + println(3 < z) + println(z == 3) + println(3 == z) + println() +} + +object Test2 { + import BigDecimal._ + + val x: BigDecimal = 1 + val y = x + 1 + val z = 1 + y + println(z) + println(z <= 3) + println(3 < z) + println(z == 3) + println(3 == z) + val a = BigDecimal(Math.MAX_LONG, Precision.DECIMAL32) + val b = BigDecimal(Test1.x) + val c = a - b + println(c) + println(c > Math.MAX_LONG) + println(c <= Math.MAX_LONG) } |