In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/f9abf36c9eba6aa5e86e3d8384ec73b2eb0fb75a?hp=3cd61afa1bd59515cd57091c4a4af93a52fec327>
- Log ----------------------------------------------------------------- commit f9abf36c9eba6aa5e86e3d8384ec73b2eb0fb75a Author: Jarkko Hietaniemi <[email protected]> Date: Fri Sep 19 16:26:38 2014 -0400 quadmath: add test actually exercising this fancy precision. M t/op/exp.t commit 79f6e7a593f558994e8fb911de159adf159c323c Author: Jarkko Hietaniemi <[email protected]> Date: Fri Sep 19 09:43:35 2014 -0400 Editorializing quadmath entry. M INSTALL ----------------------------------------------------------------------- Summary of changes: INSTALL | 10 +++++----- t/op/exp.t | 12 +++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/INSTALL b/INSTALL index 9448a85..3d0af04 100644 --- a/INSTALL +++ b/INSTALL @@ -343,16 +343,16 @@ and the long double support. =head3 quadmath -Another option for long doubles is that gcc 4.6 and later have library +One option for long doubles is that gcc 4.6 and later have a library called quadmath, which implements the IEEE 754 quadruple precision (128-bit, 113 bits of mantissa) floating point numbers. The library works at least on x86 and ia64 platforms. It may be part of your gcc installation, or you may need to install it separately. -With "Configure -Dusequadmath" you can enable its use, but note the -compiler dependency, you may need to also add "-Dcc=..." This option -also turns on -Duselongdouble. At C level the type is called C<__float128>, -(note, not "long double") but Perl source knows it as NV. +With "Configure -Dusequadmath" you can try enabling its use, but note +the compiler dependency, you may need to also add "-Dcc=...". +This option also turns on -Duselongdouble. At C level the type is called +C<__float128> (note, not "long double"), but Perl source knows it as NV. =head3 Algorithmic Complexity Attacks on Hashes diff --git a/t/op/exp.t b/t/op/exp.t index f97b6d8..eb53f1b 100644 --- a/t/op/exp.t +++ b/t/op/exp.t @@ -8,7 +8,9 @@ BEGIN { require './test.pl'; } -plan tests => 30; +use Config; + +plan tests => 31; # compile time evaluation @@ -109,3 +111,11 @@ cmp_ok(round(atan2($x1, $x2)), '==', '0.463647609', "atan2($x1, $x2)"); # atan2() tests testing with -0.0, 0.0, -1.0, 1.0 were removed due to # differing results from calls to atan2() on various OS's and # architectures. See perlport.pod for more information. + +SKIP: { + unless ($Config{usequadmath}) { + skip "need usequadmath", 1; + } + # For quadmath we have a known precision. + is(sqrt(2), '1.4142135623730950488016887242097', "quadmath sqrt"); +} -- Perl5 Master Repository
