ADTF
cStdMath

Class for standard math operations. More...

Static Public Member Functions

static tInt32 GetProgressValue (tInt32 nValue, tInt32 nTotal)
 
static tResult UnitConversion (tFloat64 *pf64Value, const cString &strSourceUnit, const cString &strDestinationUnit=cString::Empty)
 Unit Conversion. More...
 
static tBool CompareFloat (tFloat64 f64Value1, tFloat64 f64Value2, tFloat64 f64RelativeError=0.000000000000001)
 Compare of Float value with relative error. More...
 

Static Public Attributes

static const tFloat64 MATH_E
 Euler's number.
 
static const tFloat64 MATH_LOG2E
 logarithm to the basis 2 of Euler's number
 
static const tFloat64 MATH_LOG10E
 logarithm to the basis 10 of Euler's number
 
static const tFloat64 MATH_LN2
 natural logarithm of two
 
static const tFloat64 MATH_LN10
 natural logarithm of ten
 
static const tFloat64 MATH_PI
 pi
 
static const tFloat64 MATH_PI_2
 pi / 2
 
static const tFloat64 MATH_PI_4
 pi / 4
 
static const tFloat64 MATH_1_PI
 1 / pi
 
static const tFloat64 MATH_2_PI
 2 / pi
 
static const tFloat64 MATH_2_SQRTPI
 two divided by square root of pi
 
static const tFloat64 MATH_SQRT2
 square root of two
 
static const tFloat64 MATH_SQRT1_2
 square root of 1/2
 
static const tFloat64 MATH_DEG2RAD
 constant to convert from degree to radiant
 
static const tFloat64 MATH_RAD2DEG
 constant to convert from radiant to degree
 

Detailed Description

Class for standard math operations.

Definition at line 19 of file stdmath.h.

Member Function Documentation

◆ CompareFloat()

static tBool CompareFloat ( tFloat64  f64Value1,
tFloat64  f64Value2,
tFloat64  f64RelativeError = 0.000000000000001 
)
static

Compare of Float value with relative error.

Parameters
f64Value1[in] first float value to compare
f64Value2[in] second float value to compare
f64RelativeError[in] relative error in percent between 0..1 for comparisons
Return values
tTruefloat values are equal (within relative error range)
tFalsefloat values are not equal (within relative error range)
This method is real-time safe.\nSee @ref page_real_time_safe.\n

◆ GetProgressValue()

static tInt32 GetProgressValue ( tInt32  nValue,
tInt32  nTotal 
)
static
Parameters
nValue[in] Current integer value
nTotal[in] Maximum integer value that represents 100 percent.
Returns
Calculated percentage.
This method is real-time safe.\nSee @ref page_real_time_safe.\n

◆ UnitConversion()

static tResult UnitConversion ( tFloat64 pf64Value,
const cString strSourceUnit,
const cString strDestinationUnit = cString::Empty 
)
static

Unit Conversion.

This method converts a float value with a special unit into an other.

Parameters
pf64Value[inout] float value to convert
strSourceUnit[in] source unit of float value
strDestinationUnit[in] unit to convert float value to
Returns
Standard result code.