Hi - complete newbie to J here. Though I like what I've seen so far.

Here's my starter question:
I'd like to code the function that gives the inverse of a sum of
inverses (eg. like when calculating resistors in parallel)

It works fine if I just write it out as
        % +/ % 10 20 40            (ans 5.71429)

However, if I try to make a function of it, 
        invsuminv =. % +/ %
it becomes a fork (I guess that _does_ make sense), and just computes
the "cross-sum" of the inverses, as if I'd typed
           (% +/ %) 10 20 40
          0.2  0.15 0.125
         0.15   0.1 0.075
        0.125 0.075  0.05

How can I avoid this? I've tried all sorts of combinations, using @ and
& but can't seem to crack it.  Obviously something fundamental I'm not
grasping. Any help appreciated.





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

Reply via email to