[Numpy-discussion] timedelta64 remainder behavior with div by 0

Tyler Reddy tyler.je.reddy at gmail.com
Tue Jan 8 13:35:53 EST 2019


Looks like we're still on 1.16.0rc2 -- released 4 days ago.

On Tue, 8 Jan 2019 at 10:28, Eric Wieser <wieser.eric+numpy at gmail.com>
wrote:

> If we consider it a bug, we could patch it in 1.16.1 (or are we still
> waiting on 1.16.0?), which would minimize the backwards compatibility cost.
>
> Eric
>
> On Tue, 8 Jan 2019 at 10:05 Stefan van der Walt <stefanv at berkeley.edu>
> wrote:
>
>> On Tue, 08 Jan 2019 09:57:03 -0800, Tyler Reddy wrote:
>> > np.timedelta64(5) % np.timedelta64(0) -> numpy.timedelta64(0)
>> >
>> > In contrast, np.float64(1) % np.float64(0) -> nan
>> >
>> > There's a suggestion that we should switch to returning NaT for the
>> > timedelta64 case for consistency, and that this probably isn't too
>> harmful
>> > given how recent these additions are.
>>
>> That seems like a reasonable change to me; one could probably consider the
>> previous behavior a bug?
>>
>> Stéfan
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at python.org
>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190108/64fd5919/attachment.html>


More information about the NumPy-Discussion mailing list