Hi.

I'm studing floating point representation of binary numbers, and it made me notice something.

Well, actually, I noticed it before of course, but it never occurred to me to ask about it up until now:

There are some numbers, rational numbers, that can be presented in a finite decimal floating-point representation,

for example:

$\displaystyle \frac{1}{2}=0.5$

$\displaystyle \frac{3}{4}=0.75$

but some cannot, like:

$\displaystyle \frac{1}{3}=0.33333...$

$\displaystyle \frac{5}{7}=0.714285714285...$

My question is why?

what distinguish "infinite decimal floating-point representation" from the ones thatcanbe written in a finite form?

I also noticed (and correct me if I'm wrong) that when it comes tobinaryfloating-point representation, the "problem" is much bigger:

There are considerably much more fractions that cannot be represented in a finite series of digits, then the ones that can.

Why does that happen?

Thank you in advance.