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 Aardwolf

4 years ago

C++ hex floats are an interesting combination of 3 numeric bases in one!

the mantissa is written in base 16

the exponent is written in base 10

the exponent itself is a power of 2 (not of 16 or 2), so that's base 2

One can only wonder how that came to be. I think they chose base 10 for the exponent to allow using the 'f' suffix to denote float (as opposed to double)

0 comments

Aardwolf

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