Hacker News new | ask | show | jobs
by zasdffaa 1471 days ago
Depends. In the first it will depend on the branch predictor which will depend on the relative expected magnitudes of num and x

In the 2nd, which I assume should be

    { return num*num > x * x; }
then it depends on the micro-arch, as it's one basic block so no branches and assuming a deep pipeline on x64, one multiplier (pipelined), probably this is faster for 'random-ish' num and x.