Skip to content

Commit

Permalink
[v6.d REVIEW] Harden a few 0e0 tests with signed check
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Jul 21, 2018
1 parent b82436c commit 8cb7ff5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions S02-types/num.t
Expand Up @@ -589,8 +589,8 @@ ok Num === Num, 'Num === Num should be truthy, and not die';
cmp-ok cotan(my num $ = -∞), '===', NaN, '-∞';
cmp-ok cotan(my num $ = ∞), '===', NaN, '+∞';

cmp-ok cotan(my num $ = 0e0), '==', my num $ = ∞, '0e0';
cmp-ok cotan(my num $ = -0e0), '==', my num $ = -∞, '-0e0';
is-deeply cotan(my num $ = 0e0), '==', my num $ = ∞, '0e0';
is-deeply cotan(my num $ = -0e0), '==', my num $ = -∞, '-0e0';

is-approx cotan(my num $ = Ο€/12), my num $ = 2+√3, 'Ο€/12';
is-approx cotan(my num $ = Ο€/10), my num $ = √(5+2*√5), 'Ο€/10';
Expand Down Expand Up @@ -698,7 +698,8 @@ ok Num === Num, 'Num === Num should be truthy, and not die';
cmp-ok asinh(my num $ = 1e200), '==', ∞, '1e200';
#?rakudo 2 todo 'RT 129919'
cmp-ok asinh(my num $ = -1e200), '==', -∞, '-1e200';
is asinh(my num $ = -0e0).Str, '-0', '-0e0 actually gives a minus 0';
is-deeply asinh(my num $ = -0e0), -0e0,
'-0e0 actually gives a minus 0';

for @test-values.map({|($_, -$_)}) -> $x {
is-approx asinh(my num $ = $x), my num $ = log($x+√($x²+1)), ~$x;
Expand Down

2 comments on commit 8cb7ff5

@b2gills
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't going to work anyway, you needed to remove Β '==',

@zoffixznet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I forgot to run the test file before committing.

Please sign in to comment.