News for hackers. Stuff that matters.
Re:Constant Time by ohazi on Monday June 10, 2019 @08:56PM (#20152262)

    const uintSize = 32 << (^uint(0) >> 32 & 1)
> If we’re on a 64 bit platform then the exclusive or of the number zero–all zero bits–is a number with all bits set, sixty four of them to be exact.

That's not exclusive or, that's bitwise complement (~ in C). Go reuses the carat symbol for this, but xor needs two inputs.

Re:Constant Time by clappski on Tuesday June 11, 2019 @09:39AM (#20155264)
Why does Go redefine `^` to mean something that it doesn't mean in all the programming languages I know? Is there a reason that xor isn't `^`?