2 ms·
If you want to trade bytes of instructions for bytes of constants, you could store the number of days - 28, so you only need two bits of constant per month.
by toast0 12y ago
If you want to trade bytes of instructions for bytes of constants, you could store the number of days - 28, so you only need two bits of constant per month.
- saalweachter 12y agoOnce you do that, you can trade your array for a 32-bit integer: f(n) = 28 + ((0x3bbeecc >> n >> n) & 3)