This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX: emulation for logb()
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 12 Mar 2015 11:24:59 +0000 (07:24 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 12 Mar 2015 12:11:04 +0000 (08:11 -0400)
ext/POSIX/POSIX.xs

index 7652416..5a2c306 100644 (file)
@@ -2322,6 +2322,8 @@ acos(x)
        case 20:
 #ifdef c99_logb
            RETVAL = c99_logb(x);
+#elif defined(c99_log2) && FLT_RADIX == 2
+           RETVAL = Perl_floor(c99_log2(PERL_ABS(x)));
 #else
            not_here("logb");
 #endif