Skip to content
Discussion options

You must be logged in to vote

NaN support cannot be added to the core language because it requires hardware support. Most GPU architectures save on their hardware transistor budget by having their float ALUs ignore the possibility of NaN and Infinities, so even when you can construct a NaN (as in @munrocket's answer), it will result in undefined behavior instead of the IEEE754 behavior.

It may be possible to add as an optional feature in the future, but reach would be limited. I recommend that you find other values for your NO_DATA values, such as the min/max f32 values (-0xffffffp104 and 0xffffffp104 in hex float form, i.e. 0xffffff × 2104, alternatively written 0x1.fffff8p127). #3431 tracks the addition of those con…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ben-clayton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants