Skip to content

Comment on MySQL 1 – 1 = 18446744073709551615

Comments

Good reminder. Not specific to MySQL, though. This happens in many languages that have unsigned integers. The underlying bit pattern resulting from twos-complement arithmetic is the same for signed and unsigned arithmetic, but when interpreted as unsigned you get one more high bit instead of that bit representing the sign: 0 for positive, 1 for negative.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.