Skip to content

How to deal with nan value in the buffer? #8138

Answered by zvookin
liudiyi-mechmind asked this question in Q&A
Discussion options

You must be logged in to vote

Generally, unless one turns on strict_float, NaN is not allowed. If strict_float is in effect, NaNs should propagate through most mathematical operations. Comparisons involving NaN always fail per their specification. There are of course multiple kinds of NaN and theoretically strict_float should obey IEEE 754 rules, but we don't have test coverage for this and I wouldn't be at all surprised if the exact rules are not always followed. That said one should get a NaN result for calculations using NaN inputs.

strict_float can either be specified as a target flag or used as an operator around specific expressions.

As a practical matter, for performant pipelines in many domains, a NaN in the i…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@liudiyi-mechmind
Comment options

Answer selected by liudiyi-mechmind
Comment options

You must be logged in to vote
0 replies
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