https://kotlinlang.org logo
Title
b

benleggiero

10/15/2017, 2:37 AM
Is there any equivalent to
java.lang.Double.doubleToLongBits
in Kotlin/Common?
y

yoavst

10/15/2017, 6:26 AM
If I remember right it was added in kotlin 1.2
:yes: 1
b

benleggiero

10/15/2017, 4:06 PM
It's not working for me:

https://i.imgur.com/mFYsh4w.png

i

ilya.gorbunov

10/15/2017, 4:07 PM
It is provided as extensions `toBits`/`toRawBits` on
Double
And to convert back from long to double, there is
Double.fromBits
in Double companion (i.e. this one is like static)
btw, #multiplatform better fits for questions about Kotlin/Common
b

benleggiero

10/16/2017, 12:04 AM
Cool! And thank you; I'll look there in the future 🙂