[SciPy-dev] PyArray_CanCastSafely(exact,inexact) on 64-bit

Pearu Peterson pearu at scipy.org
Sun Oct 30 15:04:34 CST 2005


Hi Travis,

Number of scipy.test failures occuring on 64-bit systems are due to the 
fact that PyArray_CanCastSafely(PyArray_LONG,PyArray_DOUBLE) returns true.

Though sizeof(long)==sizeof(double) holds on 64-bit machines, shouldn't 
PyArray_CanCastSafely return false on (exact,inexact) arguments and vice 
versa?

By the definition of can_cast, no bitwise information is lost, but
it is not meaningful to pass (double*)(<pointer to long array>) to a 
numeric function, for example.

Or may be I should use some different function than PyArray_CanCastSafely 
in this situation?

Pearu




More information about the Scipy-dev mailing list