45 static const double e = 2.7182818284590452354;
47 static const double log2e = 1.4426950408889634074;
49 static const double log10e = 0.43429448190325182765;
51 static const double ln2 = 0.69314718055994530942;
53 static const double ln10 = 2.30258509299404568402;
55 static const double pi = 3.14159265358979323846;
57 static const double pi_over_2 = 1.57079632679489661923;
59 static const double pi_over_4 = 0.78539816339744830962;
69 static const double sqrt2 = 1.41421356237309504880;
71 static const double sqrt1_2 = 0.70710678118654752440;
76 #define itkTemplateFloatingToIntegerMacro(name) \
77 template< typename TReturn, typename TInput > \
78 inline TReturn name(TInput x) \
81 if ( sizeof( TReturn ) <= 4 ) \
83 return static_cast< TReturn >( Detail::name##_32(x) ); \
85 else if ( sizeof( TReturn ) <= 8 ) \
87 return static_cast< TReturn >( Detail::name##_64(x) ); \
91 return static_cast< TReturn >( Detail::name##_base< TReturn, TInput >(x) ); \
148 template<
typename TReturn,
typename TInput >
149 inline TReturn
Round(TInput x) {
return RoundHalfIntegerUp< TReturn, TInput >(x); }
177 #undef itkTemplateFloatingToIntegerMacro
179 template<
typename TReturn,
typename TInput >
182 #ifdef ITK_USE_CONCEPT_CHECKING
185 #endif // ITK_USE_CONCEPT_CHECKING
187 TReturn ret =
static_cast< TReturn
>( x );
188 if (
sizeof( TReturn ) >
sizeof( TInput )
195 else if (
sizeof( TReturn ) >=
sizeof( TInput ) )
203 else if ( static_cast< TInput >( ret ) != x
218 template <
typename T>
219 inline typename Detail::FloatIEEE<T>::IntType
257 template <
typename T>
265 const T absDifference = vcl_abs(x1 - x2);
266 if ( absDifference <= maxAbsoluteDifference )
277 return ulps <= maxUlps;
282 #endif // end of itkMath.h