Is there any distinction, in Kotlin, between signa...
# getting-started
c
Is there any distinction, in Kotlin, between signalling and quiet NaNs?
e
platform-dependent, even in Java
https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#longBitsToDouble-long-
Arithmetic operations on signaling NaNs turn them into quiet NaNs with a different, but often similar, bit pattern. However, on some processors merely copying a signaling NaN also performs that conversion. In particular, copying a signaling NaN to return it to the calling method may perform this conversion.
c
Great... Thanks
So the answer seems to be: sometimes the bit pattern can slightly change and signaling NaNs can become non-signaling NaNs, but for all intents and purposes it doesn't matter which is which and they behave the same way. Thanks!
For context, I'm implementing a subset of IEEE-754-2008 (128-bit floating point numbers) and I want the behavior to match Float and Double as much as possible
e
Java generally just uses one non-signaling NaN and treats anything else as the same JavaScript doesn't even let you construct or differentiate different NaNs Kotlin/Native probably does whatever LLVM does, which is probably whatever the platform wants to do
I haven't checked if the wasm spec says anything about this
oh wasm is weird https://github.com/WebAssembly/design/issues/1463 but also does not seem to have signaling NaN
c
Interesting 😅