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 leohutson

11 years ago

   num = 0; while (true) { try { num++; } except ( mallocFail ) { return num; } }

1 comment

leohutson

Reply

Gurkenmaster  11 years ago

Just do -1 on an unsigned number if you're that lazy.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities