Move Math constants into class (to be consistent with other constants), tested against minGW / gcc 4.7.2 and fixed various issues (mainly initializer lists, unused variables). BlackMisc compiles now in MinGW, but still issues (especially with qDebug() friend methods)

This commit is contained in:
Klaus Basan
2013-04-29 16:00:41 +02:00
parent 7c7ca2dfae
commit c6426a0759
48 changed files with 1034 additions and 920 deletions

View File

@@ -12,14 +12,6 @@ namespace BlackMisc
namespace Math
{
// Some namespace wide constant values
//! Mathematical constant Pi
const double PI = 4.0 * qAtan(1.0);
//! 2 * Pi
const double TwoPI = 2.0 * PI;
/*!
* \brief Math utils
*/
@@ -78,6 +70,26 @@ public:
*/
static double roundEpsilon(double value, double epsilon);
/*!
* \brief PI
* \return
*/
static const double &PI()
{
static double pi = 4.0 * qAtan(1.0);
return pi;
}
/*!
* \brief PI * 2
* \return
*/
static const double &PI2()
{
static double pi2 = PI();
return pi2;
}
private:
/*!
* \brief Avoid object init