Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by duped

2 months ago

> The unsigned integers should not wrap by default.

What would you do instead?

2 comments

duped

Reply

Mond_  2 months ago

How about just panic? If a wrap happens and you don't expect it, it's almost always a severe bug.

Then, dedicated APIs for wrapping behavior where you expect it to happen.

  • duped  2 months ago

    Because it adds 4-6x overhead to all integer arithmetic

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities