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

Comment by voidUpdate

5 hours ago

you could check if ret > ret * 10 + characters[i]-48, if so it has wrapped around and you return an error

2 comments

voidUpdate

Reply

thomashabets2  3 hours ago

For unsigned that could work, but signed overflow is UB.

Thiez  4 hours ago

[dead]

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities