Hacker News new | ask | show | jobs
by pcwalton 2522 days ago
But there's no such thing, semantically, as "leaving zero bits alone". The value 0 has no notion of "where it came from". The expression "x & 0" is semantically equivalent to the expression "0", in that they represent the same value.

In my view, the fact that the question even lends itself to philosophical debate like this just illustrates how exceptionally bad the question is, even by Google standards.

1 comments

Oh I don’t disagree. Literally going through bit by bit and zeroing any bit not equal to zero would be grossly inefficient especially if you know it’s unnecessary.
It's not grossly inefficient to do 64 iterations of an arithmetic loop for a trick toy function that has no reason to ever be called in practice.