This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
infnan: add POSIX::issignaling
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 7 Feb 2015 22:27:24 +0000 (17:27 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 9 Feb 2015 02:54:51 +0000 (21:54 -0500)
The current best guess for the eventual name of the C interface.
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1664.pdf)

ext/POSIX/POSIX.xs
ext/POSIX/lib/POSIX.pm
ext/POSIX/lib/POSIX.pod
ext/POSIX/t/export.t

index b1118bd..040dec7 100644 (file)
 
    j0 j1 jn y0 y1 yn
 
+ * other extensions:
+
+   issignaling (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1664.pdf)
+
  * Configure already (5.21.5) scans for:
 
    copysign*l* fpclassify isfinite isinf isnan isnan*l* ilogb*l* signbit scalbn*l*
@@ -2437,9 +2441,10 @@ fpclassify(x)
        isinf = 3
        isnan = 4
        isnormal = 5
-       lrint = 6
-       lround = 7
-        signbit = 8
+       issignaling = 6
+       lrint = 7
+       lround = 8
+        signbit = 9
     CODE:
         PERL_UNUSED_VAR(x);
        RETVAL = -1;
@@ -2475,20 +2480,23 @@ fpclassify(x)
 #endif
            break;
        case 6:
+           RETVAL = nan_is_signaling(x);
+           break;
+       case 7:
 #ifdef c99_lrint
            RETVAL = c99_lrint(x);
 #else
            not_here("lrint");
 #endif
            break;
-       case 7:
+       case 8:
 #ifdef c99_lround
            RETVAL = c99_lround(x);
 #else
            not_here("lround");
 #endif
            break;
-       case 8:
+       case 9:
        default:
 #ifdef Perl_signbit
            RETVAL = Perl_signbit(x);
index a825178..ae87410 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 
 our ($AUTOLOAD, %SIGRT);
 
-our $VERSION = '1.51';
+our $VERSION = '1.52';
 
 require XSLoader;
 
@@ -307,7 +307,7 @@ our %EXPORT_TAGS = (
                   erfc exp2 expm1 fabs fdim floor fma fmax fmin fmod
                   fpclassify frexp hypot ilogb isfinite isgreater
                   isgreaterequal isinf isless islessequal
-                  islessgreater isnan isnormal isunordered j0 j1 jn
+                  islessgreater isnan isnormal issignaling isunordered j0 j1 jn
                   ldexp lgamma log10 log1p log2 logb lrint modf nan
                   nearbyint nextafter nexttoward pow remainder remquo
                   rint round scalbn signbit sinh tan tanh tgamma trunc
index a1179f0..4e7983e 100644 (file)
@@ -793,7 +793,7 @@ construct instead.
 Returns true if the argument is a finite number (that is, not an
 infinity, or the not-a-number) [C99].
 
-See also L</isinf>, L</isnan>, and L</fpclassify>.
+See also L</nan>, L</isinf>, L</issignaling>, and L</fpclassify>.
 
 =item C<isgraph>
 
@@ -893,6 +893,12 @@ modifier is in effect?>).
 The function returns C<TRUE> if the input string is empty, or if the
 corresponding C function returns C<TRUE> for every byte in the string.
 
+=item C<issignaling>
+
+Returns true if the argument is a signaling C<NaN> (not-a-number)
+
+See also L</isnan> and L</fpclassify>.  (There is no "isquiet".)
+
 =item C<isspace>
 
 Deprecated function whose use raises a warning, and which is slated to
index caa7f2b..55c00dd 100644 (file)
@@ -105,7 +105,7 @@ my %expect = (
                  isatty iscntrl isdigit isfinite isgraph isgreater
                  isgreaterequal isinf isless islessequal
                  islessgreater islower isnan isnormal isprint ispunct
-                 isspace isunordered isupper isxdigit j0 j1 jn labs
+                 issignaling isspace isunordered isupper isxdigit j0 j1 jn labs
                  ldexp ldiv lgamma localeconv log10 log1p log2 logb
                  longjmp lrint lseek malloc mblen mbstowcs mbtowc
                  memchr memcmp memcpy memmove memset mkfifo mktime