#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
        long double a;
        long double b;
        
        a=0.L;
        b=0.L;
        
        printf ("%Lf\n", a/b);
        return 0;
}

prints

-NaN on i386 and NaN on SPARC. I believe this is a compiler bug in Sun
Studio cc.

Olga

On Sat, Apr 3, 2010 at 3:58 PM, Chris Pickett
<[email protected]> wrote:
> We've been debugging a weired problem on Solaris/Intel this week. It
> turns out that print -- $(( 0./0. )) returns nan on SPARC but -nan on
> Intel. Is this a bug or a difference in the underlying floating point
> data type representation?
>
> Chris
> --
>    ^---^
>   (@)v(@)  Chris Pickett
>   |    /   IT consultant
>  ===m==m=== [email protected]
> _______________________________________________
> ksh93-integration-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss
>



-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     [email protected]   \-`\-'----.
 `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
      /\/\                                     /\/\
      `--`                                      `--`
_______________________________________________
tools-compilers mailing list
[email protected]

Reply via email to