Portably generating infinity and NaN

skip at pobox.com skip at pobox.com
Sun Apr 15 21:14:01 EDT 2007


    Michael> Will float("NaN") work on these systems? (I don't know.) I
    Michael> guess it probably works on some system that isn't IEEE 754.

My thought was that in configure you could test if strtof("NaN") and
strtof("Inf") worked.  If not, calculate the necessary bit patterns at that
point and use conditional compilation in floatmodule.c to generate them.

Skip




More information about the Python-list mailing list