mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
committed by
Mathew Sutcliffe
parent
b0e212998f
commit
2cdc2abeb5
@@ -62,6 +62,15 @@ namespace BlackMisc
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Equal, considering equal
|
||||||
|
*/
|
||||||
|
bool CMath::epsilonEqual(double v1, double v2, double epsilon)
|
||||||
|
{
|
||||||
|
if (v1 == v2) return true;
|
||||||
|
return qAbs(v1-v2) <= epsilon;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To radians
|
* To radians
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -71,6 +71,15 @@ namespace BlackMisc
|
|||||||
*/
|
*/
|
||||||
static double roundEpsilon(double value, double epsilon);
|
static double roundEpsilon(double value, double epsilon);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Epsilon safe equal
|
||||||
|
* \param v1
|
||||||
|
* \param v2
|
||||||
|
* \param epsilon
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
static bool epsilonEqual(double v1, double v2, double epsilon = 1E-06);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Nearest integer not greater in magnitude than value, correcting for epsilon
|
* \brief Nearest integer not greater in magnitude than value, correcting for epsilon
|
||||||
* \param value
|
* \param value
|
||||||
|
|||||||
Reference in New Issue
Block a user