In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/12144562d1d1c6240a4960ddc56fc6c407ed88b6?hp=35c0561a7bae0fd58527c372c899da0d87f75d37>

- Log -----------------------------------------------------------------
commit 12144562d1d1c6240a4960ddc56fc6c407ed88b6
Author: Jarkko Hietaniemi <[email protected]>
Date:   Sat Jun 13 12:07:18 2015 -0400

    Fix @INC so that "make test" in ext/POSIX passes.

M       ext/POSIX/t/posix.t
M       ext/POSIX/t/wrappers.t

commit b97384f9474b48e181aaadbf6ac9c6206ba5ce00
Author: Jarkko Hietaniemi <[email protected]>
Date:   Sat Jun 13 11:47:23 2015 -0400

    Test these functions in more than one spot.
    
    erf/erfc/tgamma/lgamma are quite complex functions
    (and often estimated by polynomials), test them with
    more than one value.

M       ext/POSIX/t/math.t

commit a7ab4d96b409cf5089ac6cbbaf84278f1e0e80ad
Author: Jarkko Hietaniemi <[email protected]>
Date:   Sat Jun 13 11:40:00 2015 -0400

    Apparently ldblsize=10 is a real thing.
    
    (also fix an error in an #error)

M       perl.h
-----------------------------------------------------------------------

Summary of changes:
 ext/POSIX/t/math.t     | 12 ++++++++++++
 ext/POSIX/t/posix.t    |  1 +
 ext/POSIX/t/wrappers.t |  1 +
 perl.h                 | 18 +++++++++++++++---
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/ext/POSIX/t/math.t b/ext/POSIX/t/math.t
index 027f8ed..2618865 100644
--- a/ext/POSIX/t/math.t
+++ b/ext/POSIX/t/math.t
@@ -131,9 +131,21 @@ SKIP: {
     ok(isgreater(2, 1), "isgreater 2 1");
     ok(islessequal(1, 1), "islessequal 1 1");
     ok(isunordered(1, NaN), "isunordered 1 NaN");
+
+    near(erf(0.5), 0.520499877813047, "erf 0.5", 1.5e-7);
     near(erf(1), 0.842700792949715, "erf 1", 1.5e-7);
+    near(erf(9), 1, "erf 9", 1.5e-7);
+    near(erfc(0.5), 0.479500122186953, "erfc 0.5", 1.5e-7);
     near(erfc(1), 0.157299207050285, "erfc 1", 1.5e-7);
+    near(erfc(9), 0, "erfc 9", 1.5e-7);
+
+    # tgamma(n) = (n - 1)!
+    # lgamma(n) = log(tgamma(n))
+    near(tgamma(5), 24, "tgamma 5", 1.5e-7);
+    near(tgamma(5.5), 52.3427777845535, "tgamma 5.5", 1.5e-7);
     near(tgamma(9), 40320, "tgamma 9", 1.5e-7);
+    near(lgamma(5), 3.17805383034795, "lgamma 4", 1.5e-7);
+    near(lgamma(5.5), 3.95781396761872, "lgamma 5.5", 1.5e-7);
     near(lgamma(9), 10.6046029027452, "lgamma 9", 1.5e-7);
 
     # These don't work on old mips/hppa platforms because == Inf (or == -Inf).
diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t
index ec25d3a..0bafb8f 100644
--- a/ext/POSIX/t/posix.t
+++ b/ext/POSIX/t/posix.t
@@ -6,6 +6,7 @@ BEGIN {
        print "1..0\n";
        exit 0;
     }
+    unshift @INC, "../../t";
     require 'loc_tools.pl';
 }
 
diff --git a/ext/POSIX/t/wrappers.t b/ext/POSIX/t/wrappers.t
index 9fefb6a..e10a921 100644
--- a/ext/POSIX/t/wrappers.t
+++ b/ext/POSIX/t/wrappers.t
@@ -10,6 +10,7 @@ plan(skip_all => "POSIX is unavailable")
 require POSIX;
 require Symbol;
 require File::Temp;
+unshift @INC, "../../t";
 require 'loc_tools.pl';
 
 use constant NOT_HERE => 'this-file-should-not-exist';
diff --git a/perl.h b/perl.h
index 2867c7a..5c2607d 100644
--- a/perl.h
+++ b/perl.h
@@ -6859,7 +6859,13 @@ extern void moncontrol(int);
 #    define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_128_BE
 #    define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_128_BE
 #  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN
-#    if LONG_DOUBLESIZE == 12
+#    if LONG_DOUBLESIZE == 10
+#      define NV_NAN_PAYLOAD_MASK \
+         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, \
+         0x00, 0x00
+#      define NV_NAN_PAYLOAD_PERM \
+         NV_NAN_PAYLOAD_PERM_0_TO_7, 0xFF, 0xFF
+#    elif LONG_DOUBLESIZE == 12
 #      define NV_NAN_PAYLOAD_MASK \
          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, \
          0x00, 0x00, 0x00, 0x00
@@ -6876,7 +6882,13 @@ extern void moncontrol(int);
 #      error "Unexpected x86 80-bit little-endian long double format"
 #    endif
 #  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN
-#    if LONG_DOUBLESIZE == 12
+#    if LONG_DOUBLESIZE == 10
+#      define NV_NAN_PAYLOAD_MASK \
+         0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, \
+         0xff, 0xff
+#      define NV_NAN_PAYLOAD_PERM \
+         NV_NAN_PAYLOAD_PERM_7_TO_0, 0xFF, 0xFF
+#    elif LONG_DOUBLESIZE == 12
 #      define NV_NAN_PAYLOAD_MASK \
          0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, \
          0xff, 0xff, 0x00, 0x00
@@ -6890,7 +6902,7 @@ extern void moncontrol(int);
          NV_NAN_PAYLOAD_PERM_7_TO_0, \
          0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
 #    else
-#      error "Unexpected x86 80-bit little-endian long double format"
+#      error "Unexpected x86 80-bit big-endian long double format"
 #    endif
 #  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN
 /* For double-double we assume only the first double is used for NaN. */

--
Perl5 Master Repository

Reply via email to