mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps:sequence] Avoid infinite loop when computing sum of terms
Change-Id: I5264f86edd6d0464691e354e85aa136a037f358c
This commit is contained in:
@@ -272,7 +272,7 @@ float Sequence::evaluateAtAbscissa(float x, Poincare::Context * context) const {
|
||||
|
||||
float Sequence::sumOfTermsBetweenAbscissa(float start, float end, Context * context) {
|
||||
float result = 0.0f;
|
||||
if (end-start > k_maxNumberOfTermsInSum) {
|
||||
if (end-start > k_maxNumberOfTermsInSum || start + 1.0f == start) {
|
||||
return NAN;
|
||||
}
|
||||
for (float i = roundf(start); i <= roundf(end); i = i + 1.0f) {
|
||||
|
||||
Reference in New Issue
Block a user