Skip to content

Commit

Permalink
sf bug #393: fix problem with test for q[e] and q[E]
Browse files Browse the repository at this point in the history
Since PDL only suports double, there are differences
in the least significant digits for these tests in
t/pdl_from_string.t so the use of approx() with an
$eps value of 1e-15 should make this last failing test(s)
pass.
  • Loading branch information
devel-chm committed Sep 17, 2016
1 parent 77b75d9 commit 65fa69d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions t/pdl_from_string.t
Expand Up @@ -297,11 +297,19 @@ TODO: {
########################

$expected = pdl(1)->exp;
# using approx() here since PDL only has support for double data
# so there will be differences in the least significant places for
# perls compiled with uselongdouble
#
$got = pdl q[e];
is($got, $expected, 'q[e] returns exp(1)')
ok(approx($got, $expected, 1e-15), 'q[e] returns exp(1)')
or diag("Got $got");
# using approx() here since PDL only has support for double data
# so there will be differences in the least significant places for
# perls compiled with uselongdouble
#
$got = pdl q[E];
is($got, $expected, 'q[E] returns exp(1)')
ok(approx($got, $expected, 1e-15), 'q[E] returns exp(1)')
or diag("Got $got");
$expected = pdl(1, exp(1));
$got = pdl q[1 e];
Expand Down

0 comments on commit 65fa69d

Please sign in to comment.