On 9/17/2014 10:55 AM, cool-RR wrote:
Terry, that doesn't really answer the question "why", it just pushes it back to the documentation. Is there a real answer why? Why return NaN when Inf would make mathematical sense?
IEEE float('inf') and float('nan') are engineering, not math constructs. I showed that the result is consistent with the math definition. Another result (including raising) might be also. Many choices concerting inf and nan are arbitrary and any 'why' can be debated.
-- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list