http://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two

7 was the threshold I picked for using APVs in the linear representation 
of a numeric vector.  Other space-saving tricks are also used.

   lr=: 3 : '5!:5 <''y'''
   lr 3 + 4 * i. _123456
493823+_4*i.123456
   lr 123456 $ 40
123456$40
   lr 123456 $ 'a'
123456$'a'



----- Original Message -----
From: Ian Shannon <[email protected]>
Date: Thursday, February 11, 2010 14:35
Subject: Re: [Jgeneral] Bond to vector of infinity
To: General forum <[email protected]>

> Roger,
> 
> Any insight as to why 7 is a magic number?
> 
> BTW.  neat piece of replacement to produce _*i.8.  
> Though it does depend on 0 = x * 0 , rather than _ =  _ * x 
> (x scalar).    Is this type of replacement 
> general where the interpreter needs to keep a vector?
> 
> Ian
>  
> 
> -----Original Message-----
> From: [email protected] [mailto:general-
> [email protected]] On Behalf Of Roger Hui
> Sent: Friday, February 12, 2010 3:17 AM
> To: General forum
> Subject: Re: [Jgeneral] Bond to vector of infinity
> 
> Fixed for the next release.  Thank you for finding and 
> reporting this error.
> 
> 
> 
> ----- Original Message -----
> From: Ian Shannon <[email protected]>
> Date: Wednesday, February 10, 2010 22:35
> Subject: [Jgeneral] Bond to vector of infinity
> To: "[email protected]" <[email protected]>
> 
> > 
> > Hi there,
> > 
> > Notification of a interpreter error.  The error is something like:
> > If a vector to be bonded (on either left or right) includes 
> infinity 
> > (+ and/or -) and is longer than 7 items then interpreter 
> returns NaN 
> > error.
> > 
> > However if vector is longer than 7 items the interpreter
> > (cleverly) can sometimes optimise.
> > Eg   0 _ _ _ _ _ _ _ _ _   becomes
> > (_*i.10) and error does not occur.
> > 
> > 
> > 
> > J602  on win XP SP2.
> > 
> > 
> > =========
> > NB. Display of interpreter error
> >   9!:12 ''
> > 6
> >   9!:14 ''
> > j602/2008-03-03/16:45
> >    ,&_ _ _ _ _ _
> > ┌─┬─┬───────────┐
> > │,│&│_ _ _ _ _ _│
> > └─┴─┴───────────┘
> >    ,& _ _ _ _ _ _ _
> > ┌─┬─┬─────────────┐
> > │,│&│_ _ _ _ _ _ _│
> > └─┴─┴─────────────┘
> >    ,& _ _ _ _ _ _ _ _
> > |NaN error
> >    ,& __ __ __ __ __ __ __
> > ┌─┬─┬────────────────────┐
> > │,│&│__ __ __ __ __ __ __│
> > └─┴─┴────────────────────┘
> >    ,& __ __ __ __ __ __ __ __
> > |NaN error
> >    ,& 0 __ __ __ __ __ __ __ __
> > ┌─┬─┬─────────────────────────┐
> > │,│&│0 __ __ __ __ __ __ __ __│
> > └─┴─┴─────────────────────────┘
> >    ,& 0 __ __ __ __ __ __ __ __ 0
> > ┌─┬─┬───────────────────────────┐
> > │,│&│0 __ __ __ __ __ __ __ __ 0│
> > └─┴─┴───────────────────────────┘
> >    ,&  __ __ __ __ 0 0 0 0
> > |NaN error
> >    ,&  __ __ __ 0 0 0 0
> > ┌─┬─┬────────────────┐
> > │,│&│__ __ __ 0 0 0 0│
> > └─┴─┴────────────────┘
> > 
> > 
> > 7 appears to be the magic number for the length of the 
> constant 
> > vector to bond.
> > 
> > The error also occurs when bonding with other functions (on 
> both 
> > left and right).
> > 
> > 
> > Note I cannot use the wiki
> > http://www.jsoftware.com/jwiki/System/Interpreter/Bugs
> > 
> > as it won't let me reset the password - it says that recovery 
> > token (copied out of return email) is invalid.  Please let 
> > me know how to get into the system.
> > 
> > 
> > Ian
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to