diff --git a/Number_types/include/CGAL/double.h b/Number_types/include/CGAL/double.h index 4816ed63f9f..c96d7319c5b 100644 --- a/Number_types/include/CGAL/double.h +++ b/Number_types/include/CGAL/double.h @@ -169,10 +169,13 @@ template <> class Real_embeddable_traits< double > : public CGAL::unary_function< Type, bool > { public : bool operator()( const Type& x ) const { -#ifdef CGAL_CFG_IEEE_754_BUG + +#if defined CGAL_CFG_IEEE_754_BUG Type d = x; IEEE_754_double* p = reinterpret_cast(&d); return is_finite_by_mask_double( p->c.H ); +#elif !defined CGAL_CFG_NO_CPP0X_ISFINITE + return std::isfinite(x); #elif defined CGAL_CFG_NUMERIC_LIMITS_BUG return (x == x) && (is_valid(x-x)); #else diff --git a/Number_types/include/CGAL/float.h b/Number_types/include/CGAL/float.h index 15dfbfdb2b8..240d27acf02 100644 --- a/Number_types/include/CGAL/float.h +++ b/Number_types/include/CGAL/float.h @@ -119,10 +119,13 @@ public: : public CGAL::unary_function< Type, bool > { public: bool operator()( const Type& x ) const { -#ifdef CGAL_CFG_IEEE_754_BUG + +#if defined CGAL_CFG_IEEE_754_BUG Type f = x; IEEE_754_float* p = reinterpret_cast(&f); return is_finite_by_mask_float( p->c ); +#elif !defined CGAL_CFG_NO_CPP0X_ISFINITE + return std::isfinite(x); #else return (x == x) && (is_valid(x-x)); #endif