diff --git a/include/decimal.h b/include/decimal.h index 7cb0e81..854549d 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -780,13 +780,13 @@ class decimal { #if DEC_TYPE_LEVEL == 1 template typename ENABLE_IF= Prec2, decimal>::type - & operator=(const decimal &rhs) { + & operator=(const decimal &rhs) { m_value = rhs.getUnbiased() * DecimalFactorDiff::value; return *this; } #elif DEC_TYPE_LEVEL > 1 template - decimal & operator=(const decimal &rhs) { + decimal & operator=(const decimal &rhs) { if (Prec2 > Prec) { RoundPolicy::div_rounded(m_value, rhs.getUnbiased(), DecimalFactorDiff::value); @@ -900,14 +900,14 @@ class decimal { #if DEC_TYPE_LEVEL == 1 template const typename ENABLE_IF= Prec2, decimal>::type - operator+(const decimal &rhs) const { + operator+(const decimal &rhs) const { decimal result = *this; result.m_value += rhs.getUnbiased() * DecimalFactorDiff::value; return result; } #elif DEC_TYPE_LEVEL > 1 template - const decimal operator+(const decimal &rhs) const { + const decimal operator+(const decimal &rhs) const { decimal result = *this; if (Prec2 > Prec) { int64 val; @@ -937,13 +937,13 @@ template #if DEC_TYPE_LEVEL == 1 template typename ENABLE_IF= Prec2, decimal>::type - & operator+=(const decimal &rhs) { + & operator+=(const decimal &rhs) { m_value += rhs.getUnbiased() * DecimalFactorDiff::value; return *this; } #elif DEC_TYPE_LEVEL > 1 template - decimal & operator+=(const decimal &rhs) { + decimal & operator+=(const decimal &rhs) { if (Prec2 > Prec) { int64 val; RoundPolicy::div_rounded(val, rhs.getUnbiased(), @@ -982,14 +982,14 @@ template #if DEC_TYPE_LEVEL == 1 template const typename ENABLE_IF= Prec2, decimal>::type - operator-(const decimal &rhs) const { + operator-(const decimal &rhs) const { decimal result = *this; result.m_value -= rhs.getUnbiased() * DecimalFactorDiff::value; return result; } #elif DEC_TYPE_LEVEL > 1 template - const decimal operator-(const decimal &rhs) const { + const decimal operator-(const decimal &rhs) const { decimal result = *this; if (Prec2 > Prec) { int64 val; @@ -1019,13 +1019,13 @@ template #if DEC_TYPE_LEVEL == 1 template typename ENABLE_IF= Prec2, decimal>::type - & operator-=(const decimal &rhs) { + & operator-=(const decimal &rhs) { m_value -= rhs.getUnbiased() * DecimalFactorDiff::value; return *this; } #elif DEC_TYPE_LEVEL > 1 template - decimal & operator-=(const decimal &rhs) { + decimal & operator-=(const decimal &rhs) { if (Prec2 > Prec) { int64 val; RoundPolicy::div_rounded(val, rhs.getUnbiased(), @@ -1055,7 +1055,7 @@ template #if DEC_TYPE_LEVEL == 1 template const typename ENABLE_IF= Prec2, decimal>::type - operator*(const decimal& rhs) const { + operator*(const decimal& rhs) const { decimal result = *this; result.m_value = dec_utils::multDiv(result.m_value, rhs.getUnbiased(), DecimalFactor::value); @@ -1063,7 +1063,7 @@ template } #elif DEC_TYPE_LEVEL > 1 template - const decimal operator*(const decimal& rhs) const { + const decimal operator*(const decimal& rhs) const { decimal result = *this; result.m_value = dec_utils::multDiv(result.m_value, rhs.getUnbiased(), DecimalFactor::value); @@ -1086,14 +1086,14 @@ template #if DEC_TYPE_LEVEL == 1 template typename ENABLE_IF= Prec2, decimal>::type - & operator*=(const decimal& rhs) { + & operator*=(const decimal& rhs) { m_value = dec_utils::multDiv(m_value, rhs.getUnbiased(), DecimalFactor::value); return *this; } #elif DEC_TYPE_LEVEL > 1 template - decimal & operator*=(const decimal& rhs) { + decimal & operator*=(const decimal& rhs) { m_value = dec_utils::multDiv(m_value, rhs.getUnbiased(), DecimalFactor::value); return *this; @@ -1117,7 +1117,7 @@ template #if DEC_TYPE_LEVEL == 1 template const typename ENABLE_IF= Prec2, decimal>::type - operator/(const decimal& rhs) const { + operator/(const decimal& rhs) const { decimal result = *this; result.m_value = dec_utils::multDiv(result.m_value, DecimalFactor::value, rhs.getUnbiased()); @@ -1125,7 +1125,7 @@ template } #elif DEC_TYPE_LEVEL > 1 template - const decimal operator/(const decimal& rhs) const { + const decimal operator/(const decimal& rhs) const { decimal result = *this; result.m_value = dec_utils::multDiv(result.m_value, DecimalFactor::value, rhs.getUnbiased()); @@ -1150,7 +1150,7 @@ template #if DEC_TYPE_LEVEL == 1 template typename ENABLE_IF= Prec2, decimal>::type - & operator/=(const decimal &rhs) { + & operator/=(const decimal &rhs) { m_value = dec_utils::multDiv(m_value, DecimalFactor::value, rhs.getUnbiased()); @@ -1158,7 +1158,7 @@ template } #elif DEC_TYPE_LEVEL > 1 template - decimal & operator/=(const decimal &rhs) { + decimal & operator/=(const decimal &rhs) { m_value = dec_utils::multDiv(m_value, DecimalFactor::value, rhs.getUnbiased()); @@ -1197,7 +1197,7 @@ template #if DEC_TYPE_LEVEL >= 1 template typename ENABLE_IF= Prec2, decimal>::type - operator%(const decimal &rhs) const { + operator%(const decimal &rhs) const { int64 rhsInThisPrec = rhs.getUnbiased() * DecimalFactorDiff::value; int64 resultPayload = this->m_value; resultPayload %= rhsInThisPrec; @@ -1208,7 +1208,7 @@ template template typename ENABLE_IF= Prec2, decimal &>::type - operator%=(const decimal &rhs) { + operator%=(const decimal &rhs) { int64 rhsInThisPrec = rhs.getUnbiased() * DecimalFactorDiff::value; int64 resultPayload = this->m_value; resultPayload %= rhsInThisPrec; @@ -1220,7 +1220,7 @@ template #if DEC_TYPE_LEVEL > 1 template typename ENABLE_IF::type - operator%(const decimal &rhs) const { + operator%(const decimal &rhs) const { int64 thisInRhsPrec = m_value * DecimalFactorDiff::value; int64 resultPayload = thisInRhsPrec % rhs.getUnbiased(); resultPayload /= DecimalFactorDiff::value; @@ -1231,7 +1231,7 @@ template template typename ENABLE_IF::type - operator%=(const decimal &rhs) { + operator%=(const decimal &rhs) { int64 thisInRhsPrec = m_value * DecimalFactorDiff::value; int64 resultPayload = thisInRhsPrec % rhs.getUnbiased(); resultPayload /= DecimalFactorDiff::value;