floating point constants

Marty Leisner leisner at arisia.Xerox.COM
Wed Jul 26 07:00:13 AEST 1989


Is this a valid C program?  gcc 1.35 handles it fine on a sun386i --
everything else I've tried won't compile these odd constants.

/* This should print out
        inf
        -inf
        NaN
*/

main()
{
        printf("%f\n", 1.0/0.0);
        printf("%f\n", -1.0/0.0);
        printf("%f\n", 0.0/0.0);
}

marty leisner
leisner.henr at xerox.com



More information about the Comp.lang.c mailing list