[Python-Dev] Not-a-Number
Steven D'Aprano
steve at pearwood.info
Fri Apr 29 03:44:10 CEST 2011
Greg Ewing wrote:
> Taking a step back from all this, why does Python allow
> NaNs to arise from computations *at all*?
The real question should be, why does Python treat all NANs as
signalling NANs instead of quiet NANs? I don't believe this helps anyone.
> +Inf and -Inf are arguably useful elements of the algebra,
> yet Python insists on raising an exception for 1.0./0.0
> instead of returning an infinity.
I would argue that Python is wrong to do so.
As I've mentioned a couple of times now, 20 years ago Apple felt that
NANs and INFs weren't too complicated for non-programmers using
Hypercard. There's no sign that Apple were wrong to expose NANs and INFs
to users, no flood of Hypercard users confused by NAN inequality.
--
Steven
More information about the Python-Dev
mailing list