File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,8 @@ sub _make {
204204 ($p , $q ) = ($1 , 0);
205205 } elsif ($arg =~ / ^(?:$gre )?$gre \s *i\s *$ / ) {
206206 ($p , $q ) = ($1 || 0, $2 );
207+ } elsif ($arg =~ / ^(?:$gre )?\s *([+\- ]?)i\s *$ / ) {
208+ ($p , $q ) = ($1 || 0, $2 . ' 1' );
207209 } elsif ($arg =~ / ^\s *\( $gre \s *(?:,$gre \s *)?\)\s *$ / ) {
208210 ($p , $q ) = ($1 , $2 || 0);
209211 }
Original file line number Diff line number Diff line change 347347 print "ok $test \n ";
348348EOS
349349
350+ $test ++;
351+ push @script , <<EOS ;
352+ print "# remake 2+i\n ";
353+ \$ z = cplx('2+i');
354+ print "not " unless \$ z == Math::Complex->make(2,1);
355+ print "ok $test \n ";
356+ EOS
357+
358+ $test ++;
359+ push @script , <<EOS ;
360+ print "# make 3-i\n ";
361+ \$ z = Math::Complex->make('3-i');
362+ print "not " unless \$ z == cplx(3,-1);
363+ print "ok $test \n ";
364+ EOS
365+
350366 $test ++;
351367 push @script , <<EOS ;
352368 print "# emake [2,3]\n ";
You can’t perform that action at this time.
0 commit comments