I fail to understand where the tolerance comes in:

   <. 255
255
   <. (0j1-0j1)+255
255
   <. 256 %~ 255
0
   <. 256 %~ (0j1-0j1)+255
0

<. seems to do its job perfectly here. Is there a problem with | instead?

   256 | (0j1-0j1)+255
_1

The alternative obvious definition with <....@% works where | doesn't.

   256 (]- [* <....@%~) (0j1-0j1)+255
255

Marshall

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Zsbán Ambrus
Sent: Wednesday, December 08, 2010 10:26 AM
To: Programming forum
Subject: Re: [Jprogramming] #: on integer of internal complex type

On Wed, Dec 8, 2010 at 9:02 AM, bill lam <[email protected]> wrote:
> Is the following expected behavior?
>   256 256#: 255
> 0 255
>   256 256#: (0.2-0.2)+255
> 0 255
>   256 256#: (0j1-0j1)+255
> 1 _1

On Wed, Dec 8, 2010 at 9:53 AM, Roger Hui <[email protected]> wrote:
> Looks like a bug.

It's not a bug.  Tolerant <. behaves inconsistently on numbers represented
as real versus complex floats.  In addition, the dictionary never really
defines how tolerant <. works (on either reals or complexes).  The | and #:
dyads are just defined using <. and inherit the inconsistencies from it, but
are themselves implemented correctly as far as I see.

Ambrus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to