We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99548bd commit d79a5caCopy full SHA for d79a5ca
compiler/src/dotty/tools/backend/jvm/BTypes.scala
@@ -291,7 +291,7 @@ abstract class BTypes {
291
292
case LONG =>
293
if (other.isIntegralType) LONG
294
- else if (other.isRealType) DOUBLE
+ else if (other.isRealType) other
295
else uncomparable
296
297
case FLOAT =>
tests/run/i5441.check
@@ -0,0 +1,3 @@
1
+1.164309
2
3
+2.3242621
tests/run/i5441.scala
@@ -0,0 +1,8 @@
+object Test {
+ def main(args: Array[String]): Unit =
+ 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
+}
0 commit comments