walterscarborough/LibSpacey

Multiplication takes precedence over subtraction

Opened this issue · 1 comments

Hi

Inside the file flashcardGrader.cpp the following line:

static_cast<float>(flashcard.interval) - 1 * flashcard.easinessFactor

should be:

static_cast<float>(flashcard.interval - 1) * flashcard.easinessFactor

because multiplication takes precedence over subtraction (as the original algorithm report "for n>2 I(n):=I(n-1)*EF").

I(n-1) is previous interval, so it should be just static_cast<float>(flashcard.interval) * flashcard.easinessFactor