HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImathMath.h File Reference
#include "ImathNamespace.h"
#include "ImathPlatform.h"
#include <cmath>
#include <limits>
+ Include dependency graph for ImathMath.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T >
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
IMATH_HOSTDEVICE
sinx_over_x (T x)
 
template<class T >
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
equalWithAbsError (T x1, T x2, T e) IMATH_NOEXCEPT
 
template<class T >
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
equalWithRelError (T x1, T x2, T e) IMATH_NOEXCEPT
 

Function Documentation

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError ( x1,
x2,
e 
)
inline

Compare two numbers and test if they are "approximately equal":

Returns
Ttrue if x1 is the same as x2 with an absolute error of no more than e:
abs (x1 - x2) <= e  

Definition at line 152 of file ImathMath.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError ( x1,
x2,
e 
)
inline

Compare two numbers and test if they are "approximately equal":

Returns
True if x1 is the same as x2 with an relative error of no more than e,

abs (x1 - x2) <= e * x1

Definition at line 165 of file ImathMath.h.

template<class T >
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE T sinx_over_x ( x)
inline

Don Hatch's version of sin(x)/x, which is accurate for very small x. Returns 1 for x == 0.

Definition at line 136 of file ImathMath.h.