mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/sequence/graph] Improve term sum controller
Change-Id: Ic2b81e7f1c608e5a9f4f8c5a8de116433f930042
This commit is contained in:
@@ -173,7 +173,6 @@ bool Sequence::isDefined() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float Sequence::evaluateAtAbscissa(float x, Poincare::Context * context) const {
|
||||
float n = roundf(x);
|
||||
switch (m_type) {
|
||||
@@ -229,4 +228,12 @@ float Sequence::evaluateAtAbscissa(float x, Poincare::Context * context) const {
|
||||
}
|
||||
}
|
||||
|
||||
float Sequence::sumOfTermsBetweenAbscissa(float start, float end, Context * context) {
|
||||
float result = 0.0f;
|
||||
for (float i = roundf(start); i <= roundf(end); i = i + 1.0f) {
|
||||
result += evaluateAtAbscissa(i, context);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user