Comparing `Float`s, I'd like to know if `==` (and ...
# announcements
e
Comparing `Float`s, I'd like to know if
==
(and also
Float.compareTo
) will call
java.lang.Float.compare()
under the hood
k
Look at the generated bytecode.
I'm not familiar with bytecode at all
any idea what does mean?
d
In this case it will compare "in accordance with IEEE 754" since the
fcmp
opcode is used: https://stackoverflow.com/a/35647897/3638966
e
what does the
g
means? (
FCMPG
)
See the "notes" section at the end of the paragraph
e
yeah, thanks
d
Not much difference, it only matters when NaN is involved
👍 1
l
Just a tip, in IntelliJ you can also do: Tools -> Kotlin -> Show Kotlin Bytcode -> click the decompile button to show Java code.
e
there shouldnt be a difference though, right?
l
Difference in what?
e
with
View-> Show Bytecode
l
No difference, the tip was more about the "decompile" button that shows Java code
e
ok, thanks