Skip to content

Commit fe4a0bd

Browse files
committed
Method reordering
1 parent c949929 commit fe4a0bd

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

include/decimal.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,25 @@ template<int Prec2>
10901090
return *this;
10911091
}
10921092

1093+
#if DEC_TYPE_LEVEL == 1
1094+
template<int Prec2>
1095+
typename std::enable_if<Prec >= Prec2, decimal>::type
1096+
& operator/=(const decimal<Prec2> &rhs) {
1097+
m_value = dec_utils<RoundPolicy>::multDiv(m_value,
1098+
DecimalFactor<Prec2>::value, rhs.getUnbiased());
1099+
1100+
return *this;
1101+
}
1102+
#elif DEC_TYPE_LEVEL > 1
1103+
template<int Prec2>
1104+
decimal & operator/=(const decimal<Prec2> &rhs) {
1105+
m_value = dec_utils<RoundPolicy>::multDiv(m_value,
1106+
DecimalFactor<Prec2>::value, rhs.getUnbiased());
1107+
1108+
return *this;
1109+
}
1110+
#endif
1111+
10931112
template <typename T>
10941113
const decimal operator%(T n) const {
10951114
return *this % static_cast<decimal>(n);
@@ -1172,25 +1191,6 @@ template<int Prec2>
11721191
return (m_value > 0) ? 1 : ((m_value < 0) ? -1 : 0);
11731192
}
11741193

1175-
#if DEC_TYPE_LEVEL == 1
1176-
template<int Prec2>
1177-
typename std::enable_if<Prec >= Prec2, decimal>::type
1178-
& operator/=(const decimal<Prec2> &rhs) {
1179-
m_value = dec_utils<RoundPolicy>::multDiv(m_value,
1180-
DecimalFactor<Prec2>::value, rhs.getUnbiased());
1181-
1182-
return *this;
1183-
}
1184-
#elif DEC_TYPE_LEVEL > 1
1185-
template<int Prec2>
1186-
decimal & operator/=(const decimal<Prec2> &rhs) {
1187-
m_value = dec_utils<RoundPolicy>::multDiv(m_value,
1188-
DecimalFactor<Prec2>::value, rhs.getUnbiased());
1189-
1190-
return *this;
1191-
}
1192-
#endif
1193-
11941194
double getAsDouble() const {
11951195
return static_cast<double>(m_value) / getPrecFactorDouble();
11961196
}

0 commit comments

Comments
 (0)