Fix interval<T>::power(n) to round downward/upward when n is odd number
This commit is contained in:
parent
b0f2ee6de0
commit
a56bfe3397
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue