On 1/23/2012 6:12 PM, David Mertens wrote:
On Mon, Jan 23, 2012 at 3:35 PM, Chris Marshall<[email protected]>wrote:

I was trying to calculate atan2() of a [2,N] pdl
and got the following error:

  pdl>  p $allind->shape
  [2 40]

  pdl>  p atan2($allind->using(0,1))
  Compile error: Not enough arguments for atan2 at (eval 495) line 7, near
"))

  "
  BEGIN not safe after errors--compilation aborted at (eval 495) line 7.

The problem is that the prototype for atan2() appears to
require two piddle arguments, specifically.  Does anyone
know if there is a way to make the above work or is
this a restriction of the current PDL implementation?

Thanks,
Chris


Wow, that's a toughy. However, reading the docs, I see this:

Note that when calling this function explicitly you need to supply a third
argument that should generally be zero (see first example). This
restriction is expected to go away in future releases.

So, you could call it like so (note the trailing zero):

PDL::atan2($a->using(0,1), 0)

Very mysterious...thanks for the fix.  --Chris

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to