blob: 2bba345663f62e1bc54de9ad4b701ee4a5d11c8c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
object Test extends Application {
Test1
Test2
}
object Test1 {
import BigInt._
val x: BigInt = 1
val y = x + 1
val z = 1 + y
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)
}
|