Skip to content

Commit

Permalink
Infinite SF values are now considered 'invalid' (just as NaN values c…
Browse files Browse the repository at this point in the history
…urrently) so as to avoid various types of issues
  • Loading branch information
dgirardeau committed Aug 31, 2024
1 parent dea0b62 commit bb68251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/ScalarField.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace CCCoreLib
CC_CORE_LIB_API virtual void computeMinAndMax();

//! Returns whether a scalar value is valid or not
static inline bool ValidValue(ScalarType value) { return value == value; } //'value == value' fails for NaN values
static inline bool ValidValue(ScalarType value) { return std::isfinite(value); }

//! Sets the value as 'invalid' (i.e. CCCoreLib::NAN_VALUE)
inline void flagValueAsInvalid(std::size_t index) { at(index) = NaN(); }
Expand Down

0 comments on commit bb68251

Please sign in to comment.