[Numpy-discussion] sinc always returns double precision

Paul Woodford pwoodford at keywcorp.com
Tue May 8 14:03:34 EDT 2018


Sinc seems to always return double precision, even when the input is single precision:

 

In [125]: np.sinc(np.float32(0)).dtype

Out[125]: dtype('float64')

 

Is this desired behavior?  I’m guessing the promotion occurs in the multiplication by pi:

 

y = pi * where(x == 0, 1.0e-20, x)

 

Paul

_________

Paul Woodford, Ph.D.

Principal Research Engineer

KeyW Corporation

7763 Old Telegraph Road | Severn, MD 21144

Direct: 443.274.1466 | Main: 443.733.1500

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180508/5e47a31d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5202 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180508/5e47a31d/attachment.bin>


More information about the NumPy-Discussion mailing list