2 ms·
Actually, his 2x3 example is not very good. The fact that 2x3 is 2 three times is the what, not the how; in a perfect world you would just assert that nxm == n
by tikhonj 15y ago
Actually, his 2x3 example is not very good. The fact that 2x3 is 2 three times is the what, not the how; in a perfect world you would just assert that nxm == n + n + ... n m times for all n and all positive m.
This is, coincidentally, where property based testing like QuickCheck comes in.
Edit: Just pretend 2x3 has an asterisk instead of an x :)
- prodigal_erik 15y ago(FYI, 2 * 3 is okay; HN preserves * followed by whitespace.)
- tikhonj 15y agoAh, thanks. That was probably the issue, because some of my asterisks worked but others didn't. I'll keep it in mind for the future.