MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / promote

Method promote

lib/mathlib.cpp:108–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void MathLib::value::promote(const MathLib::value &v)
109{
110 if (isInt() && v.isInt()) {
111 if (mType < v.mType) {
112 mType = v.mType;
113 mIsUnsigned = v.mIsUnsigned;
114 } else if (mType == v.mType) {
115 mIsUnsigned |= v.mIsUnsigned;
116 }
117 } else if (!isFloat()) {
118 mIsUnsigned = false;
119 mDoubleValue = static_cast<double>(mIntValue);
120 mType = MathLib::value::Type::FLOAT;
121 }
122}
123
124
125MathLib::value MathLib::value::calc(char op, const MathLib::value &v1, const MathLib::value &v2)

Callers 2

calcMethod · 0.80
compareMethod · 0.80

Calls 2

isFloatFunction · 0.85
isIntMethod · 0.45

Tested by

no test coverage detected