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 shultays

3 years ago

You only need a single bit to represent a number and say that number is infinity. But if you want to waste another 63 bits and be a bit more portable:

  std::numeric_limits<double>::infinity()

0 comments

shultays

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities