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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to