diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-03 16:52:41 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-03 16:52:41 +0000 |
commit | 56dd5b296bcdfa13210bc9018d4cc5ec40d2f1f0 (patch) | |
tree | 4542ea3177c2cae986e930523bc77ad2a06061d7 | |
parent | 04070b925af8464d3aedecd339180269e7246ebd (diff) | |
download | perl-56dd5b296bcdfa13210bc9018d4cc5ec40d2f1f0.tar.gz |
Tweak the test to be happy if the accuracy is 'good enough'.
p4raw-id: //depot/perl@10408
-rwxr-xr-x | t/lib/posix.t | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/lib/posix.t b/t/lib/posix.t index 7c91eba5cd..2f29e0ddb2 100755 --- a/t/lib/posix.t +++ b/t/lib/posix.t @@ -82,7 +82,8 @@ if ($Config{d_strtod}) { # Using long double NVs may introduce greater accuracy than wanted. $n =~ s/^3.1415(8999|9000)\d*$/3.14159/ if $Config{uselongdouble} eq 'define'; - print (($n == 3.14159) && ($x == 6) ? "ok 14\n" : "not ok 14\n"); + print ((abs($n - 3.14159) < 0.00001) && ($x == 6) ? + "ok 14\n" : "not ok 14\n"); &POSIX::setlocale(&POSIX::LC_NUMERIC, $lc) if $Config{d_setlocale}; } else { print "# strtod not present\n", "ok 14\n"; } |