I had found problems with PDL::Complex that had to do with 
confusing between size 2 real arrays and complex
numbers. Nevertheless, I don't understand the origin of the problems
exemplified by the following lines (via Guillermo Ortiz) and thus, I don't
know how to deal with them in more complex codes; I don't know when to
expect the correct and when the incorrect result. I ran the lines
below through pdl2 (Perldl2 Shell v0.008) with PDL  v2.006, PERL v5.16.1:

pdl> use PDL::Complex
pdl> $x=i
pdl> $y=2*i
pdl> $z=$x/$y
pdl> p $x**2/$y**2
  0.25+0i  (correct)
pdl> p ($x/$y)**2
  0.5+0i   (incorrect)
pdl> p $z**2
  0.25+0i  (correct)
pdl> p ($q=$x/$y)**2
  0.5+0i   (incorrect)
pdl> p ($x/$y)**(2+0*i)
  0.5+0i   (incorrect)
pdl> p Cpow(i,2)
  -0.0432139 +5.29218e-18i (incorrect)
pdl> p Cpow(i,2+0*i)
  -1 +1.22465e-16i  (~ correct)

Have these problems been already addressed? Is the PDL I'm using too
old?

Best regards and thanks,
Luis

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

Reply via email to