TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

MySQL 1 – 1 = 18446744073709551615

1 pointsby jakejakeabout 9 years ago

2 comments

gregjorabout 9 years ago
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.
coreyp_1about 9 years ago
Shouldn&#x27;t that be &quot;0 - 1&quot;?<p>&quot;1 - 1&quot; will correctly be computed as &quot;0&quot;.
评论 #11275970 未加载