I had previously shown that Oleg's solution gave
different answers than Paul's solution.
http://www.jsoftware.com/pipermail/general/2007-June/030225.html
(Follow the link if you want to know the defns of
tgu and tgu3.)

From: Roger Hui rhui000 at shaw.ca
Sent: Fri Jun 1 23:01:01 HKT 2007
Subject: Re: Challenge to expert J'ers

But consider this:

   oleg=: /:@({~ i.~)

   x=: 1++/\ 1000$2^_44

   (tgu -: tgu3) i{x [ i=: ?~#x
1
   (oleg -: tgu3) i{x
0

Tolerant grade is a pretty tricky thing.  It's
not for no reason that the primitive /: is 
not tolerant.



----- Original Message -----
From: Morten Kromberg <[EMAIL PROTECTED]>
Date: Wednesday, June 6, 2007 10:41 am
Subject: RE: [Jgeneral] Re: Challenge to expert J'ers

> Yes, I can see at least one problem: If X1, X2 and X3 are in the 
> list, the
> tolerant equality might have X1=X2 and X2=X3, but X1~:X3. In which 
> case, the
> "specification is problematic".
> 
> But does this not also mean that - in theory, if not in practice 
> with Paul's
> data - Oleg's solution (and just about any other solution you can 
> think of)
> will suffer from "the same problem"?
> 
> -----Original Message-----
> From: Roger Hui [mailto:[EMAIL PROTECTED] 
> Sent: 6. juni 2007 19:28
> To: General forum
> Subject: Re: [Jgeneral] Re: Challenge to expert J'ers
> 
> > If I got this right, your need for it actually arises from the 
> > fact that
> > neither APL nor J take comparison tolerance into account when 
> sorting> floating-point values, probably for the same reason (cost 
> seemed 
> > to outweigh
> > the benefits).
> 
> Tolerance is not used in grade and sort not because
> of any difficulties in implementation, but because
> the specifications would be problematic.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to