Hi Derek, Thanks for your answer. It seems my previous suggestions for PDL::Complex were incorporated and some more improvements have been made, including handling the meaningless comparisons. Correcting the issues in the TODO blocks of t/complex.t seem to be more complicated and correcting them could have unintended consequences elsewhere, so, I would go ahead with the merge of the current complex_atan2 branch into master. Do you agree? Best regards, Luis
On Fri, Jan 18, 2019 at 11:48:01PM -0700, Derek Lamb wrote: > Hi Luis, > > This was fixed with below commit on the complex_atan2 branch. That branch > has not yet been merged into master though. In principle it could be, but > perhaps some more of the TODOs need to be taken care of first. What do you > think? > > best, > Dere > > https://github.com/PDLPorters/pdl/commit/0a9f2a3f5b4fc5e73b3b9d924cac34d48fb002f3 > > > On Jan 18, 2019, at 8:08 PM, Luis Mochan <[email protected]> wrote: > > > > In one program I made a mistake today which was difficult to find. To > > illustrate my mistake, consider the following oneliner: > > > > $ perl -MPDL -MPDL::Complex -E '$z=1+i; say $z->real > 0' > > > > The complex variable is converted to a pdl with two reals both of > > which are greater than zero, so the result is [1 1]. However, if I > > forget to take the real part and compare a complex number to a real one > > > > $ perl -MPDL -MPDL::Complex -E '$z=1+i; say $z > 0' > > > > I get a segmentation fault. If I run the same script with the debugger > > I get the message > > > > > > DB::DB(/home/mochan/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/x86_64-linux/PDL/Complex.pm:271): > > 271: &PDL::Complex::_r2C_int($_[0], $r); > > 997 levels deep in subroutine calls! > > > > The same happens if I try to compare two complex numbers. Though I > > understand > > it is meaningless to compare complex numbers, maybe a more informative > > error might be generated before or instead of the segfault. > > > > Regards, > > > > Luis > > > > > > -- > > > > o > > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > > Apdo. Postal 48-3, 62251 | (*)/\/ \ > > 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 > > > > -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ 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
