GM6000 Digital Heater Controller Branch: main
SDX-1330
Namespaces | Macros | Functions
real.h File Reference

Detailed Description

This file contains a collection of methods comparing, manipulating, etc.

floating point numbers (i.e. floats and doubles).

#include "colony_config.h"
#include <cmath>
#include <cfloat>
Include dependency graph for real.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Cpl
 The 'Cpl' namespace is the root name space for the Colony.
 
namespace  Cpl::Math
 The Math namespace provides classes, utilities, etc.
 

Macros

#define CPL_MATH_REAL_FLOAT_EPSILON   (FLT_EPSILON)
 This symbols provides the default Epsilon value when testing for 'almost equal' between to float numbers.
 
#define CPL_MATH_REAL_DOUBLE_EPSILON   (DBL_EPSILON)
 This symbols provides the default Epsilon value when testing for 'almost equal' between to double numbers.
 

Functions

template<class T >
bool Cpl::Math::almostEquals (T a, T b, T epsilon)
 This template function implements a 'almost equals' comparison function for floating points numbers.
 
bool Cpl::Math::areFloatsEqual (float a, float b, float epsilon=CPL_MATH_REAL_FLOAT_EPSILON)
 This method is short hand for almostEquals<float> AND provides a default epsilon.
 
bool Cpl::Math::areDoublesEqual (double a, double b, double epsilon=CPL_MATH_REAL_DOUBLE_EPSILON)
 This method is short hand for almostEquals<double> AND provides a default epsilon.
 

Macro Definition Documentation

◆ CPL_MATH_REAL_DOUBLE_EPSILON

#define CPL_MATH_REAL_DOUBLE_EPSILON   (DBL_EPSILON)

This symbols provides the default Epsilon value when testing for 'almost equal' between to double numbers.

Note: This is a GLOBAL setting.

◆ CPL_MATH_REAL_FLOAT_EPSILON

#define CPL_MATH_REAL_FLOAT_EPSILON   (FLT_EPSILON)

This symbols provides the default Epsilon value when testing for 'almost equal' between to float numbers.

Note: This is a GLOBAL setting.