Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!darwin.sura.net!haven.umd.edu!socrates!socrates!rockwell
From: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell)
Subject: Re: Simple J question
In-Reply-To: vpcsc4@sfsuvax1.sfsu.edu's message of Tue, 19 May 1992 03:45:53 GMT
Message-ID: <ROCKWELL.92May19003715@socrates.umd.edu>
Sender: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell)
Organization: Traveller
References: <1992May19.034553.10415@csus.edu>
Distribution: NA
Date: Tue, 19 May 1992 05:37:15 GMT

Emmett McLean:
   If I am in a J session and I type :
   a =. 2 2 2 $ i. 8  

note that this is equivalent to :
a =. i. 2 2 2

   I can find the multiplicative inverse of each layer of a by typing :
   %."2 a

Note that this is equivalent to
%. a

   What instruction do I use to "check" my result to get
   1 0 
   0 1

   1 0
   0 1

Well, you might try :
(%. a) +/ . * "2    a

   Also,( I am using the vax), I noticed that if I make a key stroke
   error and type
   %, a

   I tie up the machine and have to break to end my session.  Is there
   anything I can do to get a prompt once I have made this type-o?

Probably something wrong with the way your copy of j handles numeric
overflow.  The ideal solution would be to get a copy of j that works
properly.  Failing that, maybe try:
minv=. %.

and then use
minv a

which has fewer opportunities for division by zero.

-- 
Raul Deluth Miller-Rockwell                   <rockwell@socrates.umd.edu>
