Skip to content

Commit

Permalink
Merge pull request #23 from r0mai/nans
Browse files Browse the repository at this point in the history
Identify NANs with isnan()
  • Loading branch information
epezent authored May 10, 2020
2 parents c6e840d + 61a3124 commit 59bc426
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ inline float Remap(float x, float x0, float x1, float y0, float y1) {

/// Turns NANs to 0s
inline float ConstrainNan(float val) {
return val == NAN || val == -NAN ? 0 : val;
return isnan(val) ? 0 : val;
}

/// Turns INFINITYs to FLT_MAXs
Expand All @@ -119,7 +119,7 @@ inline float ConstrainLog(float val) {

/// Returns true if val is NAN or INFINITY
inline bool NanOrInf(float val) {
return val == INFINITY || val == NAN || val == -INFINITY || val == -NAN;
return val == INFINITY || val == -INFINITY || isnan(val);
}

/// Utility function to that rounds x to powers of 2,5 and 10 for generating axis labels
Expand Down

0 comments on commit 59bc426

Please sign in to comment.