summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-02-03 19:16:16 +0900
committerJulien Nabet <serval2412@yahoo.fr>2015-02-04 07:37:33 +0100
commit99c00b090533da9818444be2831b8da0e713e5f9 (patch)
tree3bc9b63f98caa5c2d38dc7051385ee05c0edb92e /connectivity
parent52d1de87e9a77fc7929309b0365bd786406ce022 (diff)
Fix a little bit creative pi value
Change-Id: I09802fc799a892c322d8b69f16995b2f99da1f9c
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/file/FNumericFunctions.cxx8
-rw-r--r--connectivity/source/inc/file/FNumericFunctions.hxx2
2 files changed, 6 insertions, 4 deletions
diff --git a/connectivity/source/drivers/file/FNumericFunctions.cxx b/connectivity/source/drivers/file/FNumericFunctions.cxx
index 99710645fc51..b749c3f9f317 100644
--- a/connectivity/source/drivers/file/FNumericFunctions.cxx
+++ b/connectivity/source/drivers/file/FNumericFunctions.cxx
@@ -25,6 +25,8 @@
using namespace connectivity;
using namespace connectivity::file;
+static const double fPi = 3.14159265358979323846;
+
ORowSetValue OOp_Abs::operate(const ORowSetValue& lhs) const
{
if ( lhs.isNull() )
@@ -160,7 +162,7 @@ ORowSetValue OOp_Sqrt::operate(const ORowSetValue& lhs) const
ORowSetValue OOp_Pi::operate(const ::std::vector<ORowSetValue>& /*lhs*/) const
{
- return 3.141592653589793116;
+ return fPi;
}
ORowSetValue OOp_Cos::operate(const ORowSetValue& lhs) const
@@ -225,7 +227,7 @@ ORowSetValue OOp_Degrees::operate(const ORowSetValue& lhs) const
return lhs;
double nLhs = lhs;
- return nLhs*180*(1.0/3.141592653589793116);
+ return nLhs*180*(1.0/fPi);
}
ORowSetValue OOp_Radians::operate(const ORowSetValue& lhs) const
@@ -234,7 +236,7 @@ ORowSetValue OOp_Radians::operate(const ORowSetValue& lhs) const
return lhs;
double nLhs = lhs;
- return nLhs*3.141592653589793116*(1.0/180.0);
+ return nLhs*fPi*(1.0/180.0);
}
diff --git a/connectivity/source/inc/file/FNumericFunctions.hxx b/connectivity/source/inc/file/FNumericFunctions.hxx
index 8b80c6b858ac..a8a5267b058d 100644
--- a/connectivity/source/inc/file/FNumericFunctions.hxx
+++ b/connectivity/source/inc/file/FNumericFunctions.hxx
@@ -232,7 +232,7 @@ namespace connectivity
> SELECT PI();
-> 3.141593
> SELECT PI()+0.000000000000000000;
- -> 3.141592653589793116
+ -> 3.141592653589793238
*/
class OOp_Pi : public ONthOperator