VTK
Functions
vtkMathUtilities Namespace Reference

Functions

template<class A >
bool FuzzyCompare (A a, A b)
 Perform a fuzzy compare of floats/doubles. More...
 
template<class A >
bool FuzzyCompare (A a, A b, A epsilon)
 Perform a fuzzy compare of floats/doubles, specify the allowed tolerance. More...
 
template<class A >
SafeDivision (A a, A b)
 Performs safe division that catches overflow and underflow. More...
 
template<class A >
bool NearlyEqual (A a, A b, A tol=std::numeric_limits< A >::epsilon())
 A slightly different fuzzy comparator that checks if two values are "nearly" equal based on Knuth, "The Art of Computer Programming (vol II)". More...
 

Function Documentation

◆ FuzzyCompare() [1/2]

template<class A >
bool vtkMathUtilities::FuzzyCompare ( a,
b 
)

Perform a fuzzy compare of floats/doubles.

Definition at line 40 of file vtkMathUtilities.h.

◆ FuzzyCompare() [2/2]

template<class A >
bool vtkMathUtilities::FuzzyCompare ( a,
b,
epsilon 
)

Perform a fuzzy compare of floats/doubles, specify the allowed tolerance.

Definition at line 49 of file vtkMathUtilities.h.

◆ SafeDivision()

template<class A >
A vtkMathUtilities::SafeDivision ( a,
b 
)

Performs safe division that catches overflow and underflow.

Definition at line 58 of file vtkMathUtilities.h.

◆ NearlyEqual()

template<class A >
bool vtkMathUtilities::NearlyEqual ( a,
b,
tol = std::numeric_limits<A>::epsilon() 
)

A slightly different fuzzy comparator that checks if two values are "nearly" equal based on Knuth, "The Art of Computer Programming (vol II)".

Definition at line 83 of file vtkMathUtilities.h.