Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion implot_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static inline T ImRemap01(T x, T x0, T x1) { return (x - x0) / (x1 - x0); }
// Returns always positive modulo (assumes r != 0)
static inline int ImPosMod(int l, int r) { return (l % r + r) % r; }
// Returns true if val is NAN
static inline bool ImNan(double val) { return isnan(val); }
static inline bool ImNan(double val) { return std::isnan(val); }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this problem is compiler-specific. Can you change it to the below? Then we can merge it.

Suggested change
static inline bool ImNan(double val) { return std::isnan(val); }
static inline bool ImNan(double val) { return (val != val); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return (val != val);? Doesn't this always evaluates to false?

// Returns true if val is NAN or INFINITY
static inline bool ImNanOrInf(double val) { return !(val >= -DBL_MAX && val <= DBL_MAX) || ImNan(val); }
// Turns NANs to 0s
Expand Down