You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
input is 0x7C01 which is sNaN 0.11111.0000000001
expected result is 0x7E which is qNaN 0.11111.10 - This is incorrect, as the type of NaN should be preserved in static_cast.
Instead, the expected result should be 0.11111.01 - 0x7D
The text was updated successfully, but these errors were encountered:
Yeah, it looks like we always quiet the NaN on conversions. We should be satisfying IEEE 6.2.3, preserving the signaling bit and payload as much as possible:
Conversion of a quiet NaN from a narrower format to a wider format in the same radix, and then back to
the same narrower format, should not change the quiet NaN payload in any way except to make it
canonical.
Conversion of a quiet NaN to a floating-point format of the same or a different radix that does not allow
the payload to be preserved shall return a quiet NaN that should provide some language-defined diagnostic
information.
I'd be happy to look at a PR to fix this here and here
qNaN vs sNaN
Problematic Test is Half_To_Float8E5m2 -
input is 0x7C01 which is sNaN
0.11111.0000000001
expected result is 0x7E which is qNaN
0.11111.10
- This is incorrect, as the type of NaN should be preserved in static_cast.Instead, the expected result should be
0.11111.01
- 0x7DThe text was updated successfully, but these errors were encountered: