I think that Bob and others meant the following in the context of this thread,
5!:5<'a'[a=.0.07
0.070000000000000007
0=0.07-0.070000000000000007
1
both 0.07 and 0.070000000000000007 represent the same number within the
precision of ieee floating point standard. Both of them are correct but 0.07 is
"more correct", say in serializing number into xml format.
Roger Hui wrote:
ps: I've never understood people who prefer fast answers to
correct ones.
7 - 100 * 7r100
0
7 - 100 * 0.07
_8.88178e_16
The first is slow but "correct". The second is fast but "not correct".
But there are any number of situations where I would prefer the
second approach. (The first uses exact rational arithmetic;
the second uses 64-bit floating point.)
--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm