by derleth · 14y ago · 0 comments
If you're talking about general decimal numbers, this is provably false. Pi, for example, cannot be written as a fraction.
If you're talking about floating-point numbers on a piece of finite hardware, they can all be written as fractions, and, depending on whether you use multiple-precision math, you might be able to represent all the fractions your computer can work with as decimal numbers.
Pi cannot be written as a decimal either.
Decimals _are_ a subset of the rationals. Any rational whose denominator has a prime factor other than 2 or 5 cannot be written using decimals.