Closed yawarasuuna closed 3 weeks ago
Hello @yawarasuuna, Thanks for reporting this. It will be responded to appropriately as soon as possible.
It's likely a technicality in the world of blockchain, but the general convention is if n % 2 == 0
. The reason for this is that there are instances of n % 2 which may not strictly return a 0 or a 1. An easy example is floating point numbers, which of course isn't generally a consideration on chain, but complex number types run into similar issues. The recommendation is to stick with the n % 2 == 0
convention, alternatives may work with a bunch of caveats.
Choose the best answer!
Discussed in https://github.com/Cyfrin/foundry-full-course-cu/discussions/2768