https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117
--- Comment #4 from Uroš Bizjak ---
(In reply to Julian Taylor from comment #3)
> using isinf is not correct as isinf(nan) == 0
> why does isinf do the truncation on x87 and isfinite does not?
Because isinf is expanded in a target-dependent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117
--- Comment #3 from Julian Taylor ---
using isinf is not correct as isinf(nan) == 0
why does isinf do the truncation on x87 and isfinite does not?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117
--- Comment #2 from joseph at codesourcery dot com ---
If you use -fexcess-precision=standard, the classification built-in
functions should convert values with excess range and precision to their
semantic types as required by ISO C (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117
--- Comment #1 from Uroš Bizjak ---
You can use __builtin_isinf here, so:
if (__builtin_isinf(c)) {
puts("finite");
}
else {
puts("not finite");
}
The expansion of __builtin_isinf performs value truncation