I'm having trouble with modulus giving me the wrong answer.
It's taking 734170 and dividing by 7 and is coming up with a remainder of 3, which is wrong.
Here's the bugged out code:
I was wondering if there is a special way modulus works that I'm not fully aware of that could be causing it to come up with this answer.Code:// firstDayCount is set to 734190 // and dayNum is set to 21 at this point firstDayCount = firstDayCount - (dayNum - 1) ; firstDayCount = firstDayCount % 7; // for some reason, after this line of code it comes the answer of 3 when it should be 4




Reply With Quote