Re: ext/standard/tests/math/log.phpt coredump on Tru64
| From: | (Michael Mauch) | Date: | Sun, 17 Nov 2002 22:18:48 +0000 |
| Subject: | Re: ext/standard/tests/math/log.phpt coredump on Tru64 | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91200@lists.php.net to get a copy of this message | ||
I wrote:
> % cat log.c
> #include <stdio.h>
> #include <math.h>
>
> int main()
> {
> printf("%g\n",log(0));
> }
>
> % gcc log.c -o log -lm
> % ./log
> -inf
>
> That's on Linux. On Tru64, it prints:
>
> -1.79769e+308
Apparently, there's a compiler switch to make it behave like on Linux:
% cc -ieee log.c -o log -lm
% ./log
-INF
"man cc" says:
-ieee
Ensure support of all portable features of the IEEE Standard for Binary
Floating-Point Arithmetic (ANSI/IEEE Std 754-1985), including the
treatment of denormalized numbers, NaNs, and infinities and the han-
dling of error cases. This option also sets the _IEEE_FP C preprocessor
macro.
For gcc, the same switch is named -mieee.
When PHP is compiled with -ieee, the log.phpt PASSes. Although the other
tests are not affected by -ieee, I guess it's a bit too late to
automatically add it for 4.3.0.
Regards...
Michael