On Wed, May 27, 2009 at 1:49 PM, <[email protected]> wrote: > It is known that if you approximate a number x with continuous > fraction a/b you can say that x is irrational if > ABS (a/b)* ABS (x-a/b)/x > 0,0033 > else you have a rational number.
This does not make sense, to me, in the context of computer arithmetic. First off, you have expressed this in terms of x, which means you must know the exact value of x (or have a suitably solid theoretical framework for representing x) before you can use this expression. Second, your 0.0033 epsilon value seems completely arbitrary, but 2 ^. 0.0033 _8.24332 it's something near 8 bits of mantissa. And IEEE floating point notation represents some numbers with less than 8 bits of mantissa so some rational numbers represented using floating point could be trivially classified as rational Alternatively, this mechanism depends on the quality of the approximation a/b (or, using J's notation, of a%b). That said, J's arithmetic can only treat a subset of the rational numbers. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
