`math::finite(NAN)` returns `true` when building with `WALBERLA_BUILD_WITH_FASTMATH`
Consider the following code:
#include "core/logging/Logging.h"
#include "core/math/FPClassify.h"
int main(int argc, char** argv)
{
WALBERLA_LOG_DEVEL_VAR_ON_ROOT(walberla::math::finite(NAN));
WALBERLA_LOG_DEVEL_VAR_ON_ROOT(std::isfinite(NAN));
return 0;
}
The output is as follows:
[0][DEVEL ]------(0.000 sec) walberla::math::finite(NAN) = 1
[0][DEVEL ]------(0.000 sec) std::isfinite(NAN) = 0
According to the docs, walberla::math::finite(NAN)
should return false
.
This is specially curious, considering that walberla::math::finite
simply calls std::isfinite
.
Note that the stability checker does not work because of this.