In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7bb1ed39649da5f23a3103922cedbb4e3cd82856?hp=05f7c1e8a76f2b5ef9d680a366d3be0f964c2102>
- Log ----------------------------------------------------------------- commit 7bb1ed39649da5f23a3103922cedbb4e3cd82856 Author: Jarkko Hietaniemi <j...@iki.fi> Date: Thu Oct 9 23:35:32 2014 +0200 infnan: test overflows and underflows. ----------------------------------------------------------------------- Summary of changes: t/op/infnan.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/t/op/infnan.t b/t/op/infnan.t index 3c562f3..48703d0 100644 --- a/t/op/infnan.t +++ b/t/op/infnan.t @@ -357,4 +357,18 @@ ok(!($NaN > $NInf), "NaN is not gt -Inf"); is(sin($PInf), $NaN, "sin(+Inf) is NaN"); +# === Overflows and Underflows === + +# 1e9999 (and 1e-9999) are large (and small) enough for even +# IEEE quadruple precision (magnitude 10**4932, and 10**-4932). + +cmp_ok(1e9999, '==', $PInf, "overflow to +Inf (compile time)"); +cmp_ok('1e9999', '==', $PInf, "overflow to +Inf (runtime)"); +cmp_ok(-1e9999, '==', $NInf, "overflow to -Inf (compile time)"); +cmp_ok('-1e9999', '==', $NInf, "overflow to -Inf (runtime)"); +cmp_ok(1e-9999, '==', 0, "underflow to 0 (compile time) from pos"); +cmp_ok('1e-9999', '==', 0, "underflow to 0 (runtime) from pos"); +cmp_ok(-1e-9999, '==', 0, "underflow to 0 (compile time) from neg"); +cmp_ok('-1e-9999', '==', 0, "underflow to 0 (runtime) from neg"); + done_testing(); -- Perl5 Master Repository