Hi Luis,
thank you for demonstrating. I remember now that for some reason ci
required explicit parentheses. It is one of the PP mysteries, i.e., my
lack of deep knowledge, I think.
Now, looking into PDL::Ops you will see this warning:
Returns the complex number 0 + 1i.
B<WARNING> because this is not defined as a constant (with empty
prototype), you must use it either as C<10*ci> or C<ci()*10>. If you
use it as C<ci*10> this will actually try to use 10 as a glob and pass
that to C<ci>, which will not do what you want.
Ingo
On 08.03.21 15:12, Luis Mochan wrote:
Hi Ingo,
On Mon, Mar 08, 2021 at 09:49:06AM +0100, Ingo Schmid wrote:
...
is it not doing ci() + $x (expected behaviour) rather than ci( +$x) ?
No. For example:
$ pdl2
...
pdl> $x=1+0*ci # initialize a complex variable with a real value
pdl> p $x
1+0i
pdl> p ci()+$x # this works as expected
1+1i
pdl> p ci+$x # this doesn't
pdl> p $x # and the value of $x has been changed
0+1i
Curiously,
pdl> p ci-$x
doesn't print anything either, but it doesn't change $x (I guess -$x
is assigned to a temporary variable and that is what gets modified by
ci; in ci+$x a temporary variable is not necessary so $x itself gets
modified).
Regards,
Luis
--
o
W. Luis Mochán, | tel:(52)(777)329-1734 /<(*)
Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\
Av. Universidad s/n CP 62210 | (*)/\/ \
Cuernavaca, Morelos, México | [email protected] /\_/\__/
GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general