You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by ha...@apache.org on 2016/06/20 17:19:00 UTC

incubator-quickstep git commit: Added static cast.

Repository: incubator-quickstep
Updated Branches:
  refs/heads/decimal-type 76673f5a1 -> 7e668513f


Added static cast.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/7e668513
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/7e668513
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/7e668513

Branch: refs/heads/decimal-type
Commit: 7e668513fa9e064536d7f562eee3403597b63c7d
Parents: 76673f5
Author: Hakan Memisoglu <ha...@apache.org>
Authored: Mon Jun 20 12:18:47 2016 -0500
Committer: Hakan Memisoglu <ha...@apache.org>
Committed: Mon Jun 20 12:18:47 2016 -0500

----------------------------------------------------------------------
 types/DecimalLit.hpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/7e668513/types/DecimalLit.hpp
----------------------------------------------------------------------
diff --git a/types/DecimalLit.hpp b/types/DecimalLit.hpp
index 1006927..b9f0508 100644
--- a/types/DecimalLit.hpp
+++ b/types/DecimalLit.hpp
@@ -262,6 +262,17 @@ struct DecimalLit {
     return static_cast<int>(getIntegerPart());
   }
 
+  inline operator long() const {
+    return static_cast<long>(getIntegerPart());
+  }
+
+  inline operator double() const {
+    return static_cast<double>(data_) / kMaxFractionInt;
+  }
+
+  inline operator float() const {
+    return static_cast<float>(data_) / kMaxFractionInt;
+  }
 };
 
 //** @} */