[SciPy-User] Why does generic_filter coerce input to float64?

Juan Nunez-Iglesias jni.soma at gmail.com
Sun Jan 11 18:21:10 EST 2015


Hi all,

I'm wondering, why does ndimage.generic_filter cast the input array as a
float before passing it to the user-supplied function? I have at least one
application that requires integer input. For small integers, this is not a
problem (other than resulting in at least two unnecessary casts), but for
big ones this will cause a loss of precision.

I'd love to contribute a patch but unfortunately I couldn't find the place
in the C-code where this happens.

Thanks!

Juan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150112/ffd91bcd/attachment.html>


More information about the SciPy-User mailing list