2 ms·
>Also, rearrange the calculation. Yep, for the nand2tetris course, we had division, but it was in the OS, and a really expensive operation. I wrote a program t
by SilasX 6y ago
>Also, rearrange the calculation.
Yep, for the nand2tetris course, we had division, but it was in the OS, and a really expensive operation. I wrote a program that needed to know which third of a line a point was on. (i.e. identify 4 on a 15-length line as being in the first third).
I naively wanted to do something like "if x < L / 3", but rearranged it to "if x * 3 < L". (Of course, the language only supported integers and not fractions or floating point, so I needed to do that anyway.)