Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
some basic tests that Complex can do approx
  • Loading branch information
TimToady committed Dec 16, 2015
1 parent cd6ef58 commit 5ba241d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S03-operators/relational.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 156;
plan 159;

## N.B.: Tests for infix:«<=>» (spaceship) and infix:<cmp> belong
## in F<t/S03-operators/comparison.t>.
Expand Down Expand Up @@ -197,6 +197,10 @@ is(2.4 <=> 7, Order::Less, 'Rat <=> Int');

ok exp(i * pi) =~= -1, "=~= does approximate equality";
ok exp(i * pi) -1, "≅ does approximate equality";

is sqrt((-1).Complex) 0+1i, True, "can use approximate on Complex with negligible real";
is sqrt((-1).Complex) 0+2i, False, "can use approximate on Complex with non-negligible real";
is sqrt((-1).Complex) 0+(1+1e-17)i, True, "can use approximate on Complex";

{
my $*TOLERANCE = 0.1;
Expand Down

0 comments on commit 5ba241d

Please sign in to comment.