In decimal (base 10), 1/3
can only be approximated to 0.33333 repeating.
What number is the equivalent in binary that can only be represented as an app
The numbers that can be exactly represented in base 2 are the dyadic rationals. These are numbers that can be written in the form k/2^n for some integer k and whole number n. Any number that cannot be written in that form will have a non-terminating representation in base 2.
However, you seem to be asking not about what numbers are representable in base 2, but rather what numbers are representable in some fixed floating-point type, such as float
or double
. This is a more subtle question; any number that is not a dyadic rational cannot be represented, but not all dyadic rationals can be represented either.