blob: 5ca2e8daaa84c4a0b7c2113a5518e33f215b101b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
class Test(val x: Long) {
def sameDirection(y: Long): Boolean =
(y == 0 || x == 0 || ((y > 0) == (x > 0)))
}
object Test {
def main(args: Array[String]) {
val b = new Test(1L)
assert(!b.sameDirection(-1L))
}
}
|