Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I recall that it was either old versions of Solitaire or Freecell that had the same issue. I remember intentionally losing games until my points were -32767ish, and it was the first time I experienced integer wraparound as a kid. That's the sort of thing that teaches you a lot unintentionally.

Anyway, I think that it's not really surprising that they'd use a signed integer in either case. In every codebase I've ever worked on, signed ints are the default merely because they're the obvious choice for a number. I only see uints when it actually matters, or when a developer is overly pedantic.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: