- #36
SammyS
Staff Emeritus
Science Advisor
Homework Helper
Gold Member
- 11,948
- 1,543
Yes. I'm not sure about that "%" operation.Vital said:Yes, I thought so also when I initially came up with this same equation, so I thought that my math is completely incorrect, and I started asking for help, because the program doesn't compute it this way somehow, and I get completely different results. Well, maybe it's some problem with computing the remainder when the quotient is negative. It might be the case. I have to investigate that further.
Thank you so much for your huge patience and your help!
It appears that the values you are using for " i " also fall in the [ 0, 25 ] interval. If that's the case, and the problem is with computing the remainder for negatives, then adding 26 (or any positive multiple of 26), before applying the "%" operation should solve the problem.