sorry for noise,  original definition provided inverses on negative y.

exp =: (^^:(0~:]))"0


----- Original Message -----
From: 'Pascal Jasmin' via Programming <[email protected]>
To: Programming forum <[email protected]>
Cc: 
Sent: Monday, July 28, 2014 3:50:49 PM
Subject: [Jprogramming] ^ and imaginary numbers

   exp
=: ^ ^:]"0

   100 1 2 exp 1 0 0 
100 0 0 
   100 1 2 ^ 1 0 0 
100 1 1 

both behave as I wish

when I want this

   100 1 2 ^ 1 1 _2 
100 1 0.25 

I get with exp, this

   100 1 2 exp 1 1 _2 
100 1 2.21455j1.95289 

is there a way to define exp such that it does not return imaginary numbers?
----------------------------------------------------------------------
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