Get the latest tech news

Most ints are not floats


Most numbers that are representable as machine integers are not exactly representable as floating point numbers.

To make the statement above precise, we have to be more specific about what we mean by computer integers and floating point numbers. The calculations for 64-bit integers and 64-bit floating point numbers are analogous. Python’s integers have unlimited range, while its floating point numbers correspond to int64.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of ints

ints

Photo of floats

floats