3 ms·
hmm -- https://looo.lol/?x=65536 https://looo.lol/?x=65536
by hohokus 3y ago
hmm -- https://looo.lol/?x=65536 https://looo.lol/?x=65536
- H8crilA 3y agoThere are only two hard things in programming: 1) off by one errors (in this case it comes in the annoying form of messed up floor/ceil calculations)
- layer8 3y agoNone of the powers of two work: https://looo.lol/?x=1 https://looo.lol/?x=1 (I like the “Binary math can seem hard, but it's actually quite simple.”) https://looo.lol/?x=2 https://looo.lol/?x=2 https://looo.lol/?x=4 https://looo.lol/?x=4
- qweqwe14 3y agoThis is because for any n-bit number, the maximum value is 2^n - 1, e.g. 2^8 - 1 = 255 But the number of values is just 2^n, because that includes zero.