Assign NaN, get zero

Lisandro Dalcin dalcinl at
Sat Nov 11 15:30:06 CST 2006

On 11/11/06, Stefan van der Walt <stefan at> wrote:
> NaN (or inf) is a floating point number, so seeing a zero in integer
> representation seems correct:
> In [2]: int(N.nan)
> Out[2]: 0L

Just to learn myself: Why int(N.nan) should be 0? Is it C behavior?

Lisandro Dalcín
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

More information about the Numpy-discussion mailing list