Skip to content

Comment on Float Exposedparent

Comments

You mean ±9,007,199,254,740,993.0 for 64-bit floats. :-)

For other curious readers, these are one beyond the largest integer values that can be represented accurately. In other words, the next representable value away from zero after ±16,777,216.0 is ±16,777,218.0 in 32 bits -- the value ±16,777,217.0 cannot be represented, and will be rounded somewhat hand-wavingly (usually towards zero).

Precision rounding is one of those things that people often overlook.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.