mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 14:50:44 +01:00
[sequence] Sequence::sumBetweenBounds: avoid repetitive evaluations of std::round
This commit is contained in:
committed by
LeaNumworks
parent
269f479c29
commit
84c6c02192
@@ -196,7 +196,9 @@ Expression Sequence::sumBetweenBounds(double start, double end, Poincare::Contex
|
||||
if (end-start > ExpressionNode::k_maxNumberOfSteps || start + 1.0 == start) {
|
||||
return Float<double>::Builder(NAN);
|
||||
}
|
||||
for (double i = std::round(start); i <= std::round(end); i = i + 1.0) {
|
||||
start = std::round(start);
|
||||
end = std::round(end);
|
||||
for (double i = start; i <= end; i = i + 1.0) {
|
||||
/* When |start| >> 1.0, start + 1.0 = start. In that case, quit the
|
||||
* infinite loop. */
|
||||
if (i == i-1.0 || i == i+1.0) {
|
||||
|
||||
Reference in New Issue
Block a user