NaN Vs None

Peck, Jon peck at spss.com
Fri Sep 23 11:16:01 EDT 2005


In choosing a way to represent a value of "no information" for a float, would it be better to use NaN or None?  None has the advantage of standard behavior across platforms, but NaN seems to propagate more easily - at least on Windows.

For example,

 

NaN+1 = NaN

but

None+1

raises an exception.

 

Thanks in advance for any advice.

 

 

Jon K Peck (Kim)

peck at spss.com <mailto:peck at spss.com> 

312-651-3435

233 S Wacker Dr

Chicago, IL 60606

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050923/22ec3e59/attachment.html>


More information about the Python-list mailing list