Skip to content

Commit

Permalink
[t/spec] test for Complex.re and .im
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@25776 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Mar 9, 2009
1 parent 1d2334c commit 6512730
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions S32-num/complex.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ use v6;

use Test;

plan 138;
plan 140;

=begin pod
# Basic tests functions specific to complex numbers.

Basic tests functions specific to complex numbers.
# L<S32/Num/=item re>

L<S29/Num/"=item cis">
=end pod
{
is (1 + 2i).re, 1, 'Complex.re works';
is (1 + 2i).im, 2, 'Complex.im works';
}

# L<S29/Num/"=item cis">
my $pi = 3.141592653589793238;

{
Expand Down Expand Up @@ -84,3 +86,4 @@ my $pi = 3.141592653589793238;
is_approx(4.unpolar(3*$pi/4), -$s + ($s)i,"4.unpolar(pi/4) == -2+2i");
is_approx(4.unpolar($pi), -4, "4.unpolar(pi) == -4");
}

0 comments on commit 6512730

Please sign in to comment.