JS backend: fixed the division operation for integral types.

#KT-2342 fixed
This commit is contained in:
Zalim Bashorov
2013-07-22 20:37:58 +04:00
parent e8b95ca074
commit bf60cb2fee
3 changed files with 28 additions and 8 deletions
@@ -0,0 +1,19 @@
package foo
fun test(a: Int, b: Int, expected: Int): String {
val result = a / b
if (expected == result) return "OK"
return "$a / $b = $result. Expected $expected"
}
fun box(): String {
var r = test(10, 3, 3)
if (r != "OK") return r
r = test(49, 6, 8)
if (r != "OK") return r
if (2133 / 3 / 7 / (91 / 5) != 5) return "2133 / 3 / 7 / (91 / 5) != 5"
return "OK"
}