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 <[email protected]> Authored: Mon Jun 20 12:18:47 2016 -0500 Committer: Hakan Memisoglu <[email protected]> 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; + } }; //** @} */
