Cyfrin / foundry-full-course-cu

GNU General Public License v3.0
2.98k stars 694 forks source link

Modulo calculation examples are wrong #121

Closed npa528 closed 1 year ago

npa528 commented 1 year ago

Lesson

Lesson 9

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://www.youtube.com/watch?v=sas02qSFZ74&t=14654s

Describe the bug

In video, Lesson 9, Chapter Chainlink VRF Recap where you explain modulo (timestamp 4:04:27),

you mention some modulo calculations that are wrong:

2 % 3 = 1  // This is WRONG! Correct result is 2
2 % 6 = 0  // This is WRONG! Correct result is 2
2 % 7 = 1  // This is WRONG! Correct result is 2

I assume you wanted to say:


3 % 2 = 1
6 % 2 = 0
7 % 2 = 1
PatrickAlphaC commented 1 year ago

Hello! Perhaps... But 3 % 2 == 1.

The answer to all of the above is indeed 2.