JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::Tolerance< Type > Class Template Reference

A class encapsulating both relative and absolute tolerances for use in floating-point comparisons. More...

#include <juce_MathsFunctions.h>

Collaboration diagram for juce::Tolerance< Type >:

Public Member Functions

 Tolerance ()=default
 
Type getAbsolute () const
 
Type getRelative () const
 
Tolerance withAbsolute (Type newAbsolute)
 Returns a copy of this Tolerance object with a new absolute tolerance.
 
Tolerance withRelative (Type newRelative)
 Returns a copy of this Tolerance object with a new relative tolerance.
 

Private Attributes

Type absolute {}
 
Type relative {}
 

Detailed Description

template<typename Type>
class juce::Tolerance< Type >

A class encapsulating both relative and absolute tolerances for use in floating-point comparisons.

See also
approximatelyEqual, absoluteTolerance, relativeTolerance

@tags{Core}

Constructor & Destructor Documentation

◆ Tolerance()

template<typename Type >
juce::Tolerance< Type >::Tolerance ( )
default

Member Function Documentation

◆ getAbsolute()

template<typename Type >
Type juce::Tolerance< Type >::getAbsolute ( ) const
inline

◆ getRelative()

template<typename Type >
Type juce::Tolerance< Type >::getRelative ( ) const
inline

◆ withAbsolute()

template<typename Type >
Tolerance juce::Tolerance< Type >::withAbsolute ( Type  newAbsolute)
inline

Returns a copy of this Tolerance object with a new absolute tolerance.

If you just need a Tolerance object with an absolute tolerance, it might be worth using the absoluteTolerance() function.

See also
getAbsolute, absoluteTolerance

References juce::Tolerance< Type >::absolute, and juce::withMember().

Referenced by juce::absoluteTolerance().

◆ withRelative()

template<typename Type >
Tolerance juce::Tolerance< Type >::withRelative ( Type  newRelative)
inline

Returns a copy of this Tolerance object with a new relative tolerance.

If you just need a Tolerance object with a relative tolerance, it might be worth using the relativeTolerance() function.

See also
getRelative, relativeTolerance

References juce::Tolerance< Type >::relative, and juce::withMember().

Referenced by juce::relativeTolerance().

Member Data Documentation

◆ absolute

template<typename Type >
Type juce::Tolerance< Type >::absolute {}
private

◆ relative

template<typename Type >
Type juce::Tolerance< Type >::relative {}
private

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