Re: testing for rationality of numbers?


[Prev][Next][Index][Thread]

Re: testing for rationality of numbers?



On Tue, 17 Dec 1996, Ian Turner wrote:

> Does anyone know of a way to test (via a program of some sort) if a
> number is rational? I'm writing a program which will display numbers
> with radicals, pi, or both, in their algerbraic form. I have an 85.
> --
> -----
>   Ian Turner (Vectro)     Happy holidays!
>   Turner Computers
>

This may be a little out of line.., but I don't think it is worth while to
test if a number is rational or not.. Aren't all numbers stored on a
computer (caluator, whatever) rational, additionally what the calculator
says is "pi", is actually something that is "close" to pi, accuarate to at
most 14 digits (see the accuracy info in the manual).  The manual does not
say explicitly, but I assume it uses floating point athrithmatic.  And to
the best of my knowledge, the floating point number set is a subset of
the real number (rational + irrational) set.

I do think your program would be useful, but I expect it can be done (to
14 digits or so) although I think it would be fairly slow, maybe??  Good
luck.
__________________________
John Logan
n9342326@henson.cc.wwu.edu


References: