-
-
Save soc/455aa2be8250537da3b5b3ac1d13578e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun cmp(x: Double, y: Double) = | |
let l = x.asLong | |
let m = y.asLong | |
let ls = l.sign | |
let ms = m.sign | |
if (ls == ms) | |
if (ls != -1) | |
l.compareTo(m) | |
else | |
m.compareTo(l) | |
else if (l <= 0) | |
l.compareTo(m) | |
else | |
m.compareTo(l) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment