4 ms·
In the good old days half = num >> 1 Was standard practice and understandable by most engineers, as well as far and away much faster than a divide. Now-a-day
by dktoao 6y ago
In the good old days
half = num >> 1
Was standard practice and understandable by most engineers, as well as far and away much faster than a divide.
Now-a-days, using a compiled language they are going to be translated into the same machine code supporting your point. However, it might still be a good idea in a scripting language doing heavy math lifting.