From 65843c0f33efc6b80d1bec1c4bfde40d0a428ffb Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Fri, 17 Sep 1999 14:03:44 +0000 Subject: [PATCH] UNICOS has sloppy division/modulo for floating point numbers. p4raw-id: //depot/cfgperl@4173 --- t/op/arith.t | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/t/op/arith.t b/t/op/arith.t index f1bd827..fe2f0f4 100755 --- a/t/op/arith.t +++ b/t/op/arith.t @@ -10,7 +10,14 @@ try 1, 13 % 4 == 1; try 2, -13 % 4 == 3; try 3, 13 % -4 == -3; try 4, -13 % -4 == -1; -try 5, abs( 13e21 % 4e21 - 1e21) < 1e6; -try 6, abs(-13e21 % 4e21 - 3e21) < 1e6; -try 7, abs( 13e21 % -4e21 - -3e21) < 1e6; -try 8, abs(-13e21 % -4e21 - -1e21) < 1e6; + +my $limit = 1e6; + +# Division (and modulo) of floating point numbers +# seem to be rather sloppy in Cray. +$limit = 1e8 if $^O eq 'unicos'; + +try 5, abs( 13e21 % 4e21 - 1e21) < $limit; +try 6, abs(-13e21 % 4e21 - 3e21) < $limit; +try 7, abs( 13e21 % -4e21 - -3e21) < $limit; +try 8, abs(-13e21 % -4e21 - -1e21) < $limit; -- 2.7.4