MathLib
Loading...
Searching...
No Matches
Functions | Friends
Equality

Functions

bool approximately_equal_to (float input, float near_to, float tolerance=0.0002f)
 
bool approximately_equal_to (double input, double near_to, double tolerance=0.0002)
 
bool approximately_equal_to (long double input, long double near_to, long double tolerance=0.0002l)
 

Friends

constexpr bool approximately_equal_to (const BasicUnitRGB< T > &value_to_test, const BasicUnitRGB< T > &value_it_should_be, T tolerance=T{0.0002})
 
constexpr bool approximately_equal_to (const BasicHue< T > &value_to_test, const BasicHue< T > &value_it_should_be, T tolerance=T{0.0002})
 
constexpr bool approximately_equal_to (const BasicHSV< T > &value_to_test, const BasicHSV< T > &value_it_should_be, T tolerance=T{0.0002})
 
constexpr bool approximately_equal_to (const BasicHSL< T > &value_to_test, const BasicHSL< T > &value_it_should_be, T tolerance=T{0.0002})
 
constexpr bool approximately_equal_to (const BasicRadian< T > &value_to_test, const BasicRadian< T > &value_it_should_be, T tolerance=T{0.0002})
 
constexpr bool approximately_equal_to (const BasicDegree< T > &value_to_test, const BasicDegree< T > &value_it_should_be, T tolerance=T{0.0002})
 

Detailed Description

Compares two BasicUnitRGB inputs equal, component-wise, to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal

Compares two BasicHue inputs equal to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal
See also
Equality

Compares two BasicHSV inputs equal, component-wise, to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal

Compares two BasicHSL inputs equal, component-wise, to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal

Compares two BasicRadian inputs equal to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal
See also
Equality

Compares two BasicDegree inputs equal to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal
See also
Equality

Compare two values for equality with a tolerance

Parameters
inputThe first value to compare
near_toThe second value to compare
toleranceThe minimum value for being considered equal
Returns
true if the two are equal within tolerance , false otherwise

Function Documentation

◆ approximately_equal_to() [1/3]

bool approximately_equal_to ( double  input,
double  near_to,
double  tolerance = 0.0002 
)
inline

◆ approximately_equal_to() [2/3]

bool approximately_equal_to ( float  input,
float  near_to,
float  tolerance = 0.0002f 
)
inline

◆ approximately_equal_to() [3/3]

bool approximately_equal_to ( long double  input,
long double  near_to,
long double  tolerance = 0.0002l 
)
inline

Friends

◆ approximately_equal_to [1/6]

template<std::floating_point T>
constexpr bool approximately_equal_to ( const BasicDegree< T > &  value_to_test,
const BasicDegree< T > &  value_it_should_be,
T  tolerance = T{0.0002} 
)
friend

#include <lib/include/Math/math/Angle.hpp>

Definition at line 404 of file Angle.hpp.

◆ approximately_equal_to [2/6]

template<std::floating_point T>
constexpr bool approximately_equal_to ( const BasicHSL< T > &  value_to_test,
const BasicHSL< T > &  value_it_should_be,
T  tolerance = T{0.0002} 
)
friend

#include <lib/include/Math/color/Types.hpp>

Definition at line 1144 of file Types.hpp.

◆ approximately_equal_to [3/6]

template<std::floating_point T>
constexpr bool approximately_equal_to ( const BasicHSV< T > &  value_to_test,
const BasicHSV< T > &  value_it_should_be,
T  tolerance = T{0.0002} 
)
friend

#include <lib/include/Math/color/Types.hpp>

Definition at line 935 of file Types.hpp.

◆ approximately_equal_to [4/6]

template<std::floating_point T>
constexpr bool approximately_equal_to ( const BasicHue< T > &  value_to_test,
const BasicHue< T > &  value_it_should_be,
T  tolerance = T{0.0002} 
)
friend

#include <lib/include/Math/color/Types.hpp>

Definition at line 668 of file Types.hpp.

◆ approximately_equal_to [5/6]

template<std::floating_point T>
constexpr bool approximately_equal_to ( const BasicRadian< T > &  value_to_test,
const BasicRadian< T > &  value_it_should_be,
T  tolerance = T{0.0002} 
)
friend

#include <lib/include/Math/math/Angle.hpp>

Definition at line 134 of file Angle.hpp.

◆ approximately_equal_to [6/6]

template<std::floating_point T>
constexpr bool approximately_equal_to ( const BasicUnitRGB< T > &  value_to_test,
const BasicUnitRGB< T > &  value_it_should_be,
T  tolerance = T{0.0002} 
)
friend

#include <lib/include/Math/color/Types.hpp>

Definition at line 379 of file Types.hpp.