4 ms·
std::isfinite
- tcbawo 4y agoLast time I tried, this function doesn’t work with -ffast-math enabled. I think this is fairly common knowledge. But, it would be nice if compilers produce more obvious warnings when using unsupported std library calls given the compiler flags.
- optimalsolver 4y agoWhich compiler?
- tcbawo 4y agoFairly certain it was GCC. I managed to find a workaround that did seem to work for ‘isnan’, something along the lines of: !(int(f <= 0.0f) + int(f > 0.0f)) Which only works out to true when f is neither <= 0 or > 0.