File tree 3 files changed +17
-3
lines changed
compiler/src/dotty/tools/backend/jvm
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -290,9 +290,12 @@ abstract class BTypes {
290
290
}
291
291
292
292
case LONG =>
293
- if (other.isIntegralType) LONG
294
- else if (other.isRealType) DOUBLE
295
- else uncomparable
293
+ other match {
294
+ case INT | BYTE | LONG | CHAR | SHORT => LONG
295
+ case DOUBLE => DOUBLE
296
+ case FLOAT => FLOAT
297
+ case _ => uncomparable
298
+ }
296
299
297
300
case FLOAT =>
298
301
if (other == DOUBLE ) DOUBLE
Original file line number Diff line number Diff line change
1
+ 1.164309
2
+ 1.164309
3
+ 2.3242621
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ def main (args : Array [String ]): Unit =
3
+ def a (): Float = java.lang.Float .intBitsToFloat(1079290514 )
4
+ def b (): Long = 1412906027847L
5
+ println(b() % a())
6
+ println((b().toFloat % a().toFloat).toFloat)
7
+ println((b().toDouble % a().toDouble).toFloat)
8
+ }
You can’t perform that action at this time.
0 commit comments