Hacker News new | ask | show | jobs
by userbinator 2 days ago
Everyone knows that the != operator is a surplus of the C language, use only the minus operator.

It's notable that on most CPUs, the comparison instruction is equivalent to a subtraction but without writing the actual result.

1 comments

Wouldn't XOR or something be much quicker than all the steps involved in subtraction?
They’ve both had the exact same cost (both throughput and latency) on just about any ALU designed in the last several decades. There are no separate steps involved in the function of a full adder.