Skip to content

Commit

Permalink
Add a comment about use cases of util_*_infinity()
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer authored Nov 18, 2024
1 parent 7ff99b3 commit fa715ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/util/fpclassify.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ int util_isnan(double x);
int util_isinf(float x);
int util_isinf(double x);

// The following functions are only used in testing code.
// Don't use them in other -ffast-math code to avoid undefined behavior in
// floating-point arithmetic where the compiler assumes that arguments and
// results are not NaNs or +-Infs. For checking external librarie's return
// values use the appropiated function above.
float util_float_infinity();
double util_double_infinity();

0 comments on commit fa715ff

Please sign in to comment.