Fix interval<T>::power(n) to round downward/upward when n is odd number

This commit is contained in:
Soonho Kong 2013-08-14 16:35:51 -07:00
parent b0f2ee6de0
commit a56bfe3397

View file

@ -811,10 +811,14 @@ void interval<T>::power(unsigned n) {
}
} else {
// Remark: when n is odd x^n is monotonic.
if (!m_lower_inf)
if (!m_lower_inf) {
round_to_minus_inf();
power(m_lower, n);
if (!m_upper_inf)
}
if (!m_upper_inf) {
round_to_plus_inf();
power(m_upper, n);
}
}
}