From 28ddb5158dbe2a633a11f77ad7145ceae08abbf3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 28 Oct 2015 16:27:20 +0100 Subject: Enable std::isfinite/nan/inf on MSVC 2013 and newer and clang. Fix isinf for gcc4.4 and older msvc with fast-math. --- test/fastmath.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/fastmath.cpp') diff --git a/test/fastmath.cpp b/test/fastmath.cpp index 2911c0544..16462d54f 100644 --- a/test/fastmath.cpp +++ b/test/fastmath.cpp @@ -18,6 +18,14 @@ void check(bool b, bool ref) std::cout << " BAD "; } +#if EIGEN_COMP_MSVC < 1800 +namespace std { + template bool (isfinite)(T x) { return _finite(x); } + template bool (isnan)(T x) { return _isnan(x); } + template bool (isinf)(T x) { return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF; } +} +#endif + template void check_inf_nan(bool dryrun) { Matrix m(10); -- cgit v1.2.3