Is .2 irrational?

Israel Pinkas pinkas at mipos3.UUCP
Fri Jan 9 03:20:24 AEST 1987


In article <568 at brl-sem.ARPA> ron at brl-sem.ARPA (Ron Natalie <ron>) writes:
>Gee, how do you deal with 1/3?  I'm not sure how I do that even on
>a decimal computer.  Perhaps you meant that can handle an exact represntation
>of all fractions of the form INTEGER/(Power of 10)

People, I think that you are forgetting the definition of the term
rational.  Rational numbers are defined to be numbers which can be
represented as a fraction of two integers.  Thus, 1/3, 22/7, and 42 are all
rational numbers, whereas e, pi, and i, are not.

What the original poster was asking, I think, is whether it is possible to
represent the number 0.2 (decimal) in binary with a fixed (read limited)
number of digits without losing accuracy.  The answer is no.  The reason is
that 0.2 is really 1/5, and 5 is not a divisor of any power of two.  (5 is
a divisor of a power of 10, 10^1, thus 1/5 can be represented in decimal
with only 1 decimal place.)

-Israel
-- 
----------------------------------------------------------------------
UUCP:	{amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!pinkas
ARPA:	pinkas%mipos3.intel.com at relay.cs.net
CSNET:	pinkas%mipos3.intel.com



More information about the Comp.lang.c mailing list