Public Types | List of all members
blaze::Epsilon Class Reference

Numerical epsilon value for floating point data types.The Epsilon class is a wrapper class around the functionality of the blaze::Limits class. It represents the smallest difference between two values of any floating point data type. In order to assign an epsilon value, the Epsilon class can be implicitly converted to the three built-in floating point data types float, double and long double.
In order to handle epsilon values conveniently, the global Epsilon instance blaze::epsilon is provided, which can be used wherever a floating point data type is required. More...

#include <Epsilon.h>

Public Types

using NegativeType = NegativeEpsilon< Epsilon >
 The negative epsilon type.
 

Public Member Functions

Constructor
constexpr Epsilon ()
 The default constructor of the Epsilon class.
 
Unary plus/minus operators
constexpr const Epsilonoperator+ () const
 Returns the positive epsilon value for all floating point data types. More...
 
constexpr const NegativeType operator- () const
 Returns the negative epsilon value for all floating point data types. More...
 
Conversion operators
template<typename T >
constexpr operator const T () const
 Conversion operator to the required floating point data type. More...
 

Private Member Functions

Forbidden operations
Epsilonoperator= (const Epsilon &)
 Copy assignment operator (private & undefined)
 
void * operator & () const
 Address operator (private & undefined)
 

Detailed Description

Numerical epsilon value for floating point data types.

The Epsilon class is a wrapper class around the functionality of the blaze::Limits class. It represents the smallest difference between two values of any floating point data type. In order to assign an epsilon value, the Epsilon class can be implicitly converted to the three built-in floating point data types float, double and long double.
In order to handle epsilon values conveniently, the global Epsilon instance blaze::epsilon is provided, which can be used wherever a floating point data type is required.

float f = epsilon; // Assigns the positive epsilon for single precision values
double d = -epsilon; // Assigns the negative epsilon for double precision values

Member Function Documentation

◆ operator const T()

template<typename T >
constexpr blaze::Epsilon::operator const T ( ) const
inline

Conversion operator to the required floating point data type.

The conversion operator returns the smallest possible difference between values of the floating point data type T.

◆ operator+()

constexpr const Epsilon & blaze::Epsilon::operator+ ( ) const
inline

Returns the positive epsilon value for all floating point data types.

Returns
The positive epsilon value.

◆ operator-()

constexpr const Epsilon::NegativeType blaze::Epsilon::operator- ( ) const
inline

Returns the negative epsilon value for all floating point data types.

Returns
The negative epsilon value.

The documentation for this class was generated from the following file: