<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> </head> <body style="font-family:Helvetica;color:#000000;font-size:13px;"><div id="CanaryBody"> <div> I would say this is desirable behaviour, but I’m still +0.8 on this for backward compatibility reasons.</div><div><br></div><div>I doubt anyone would build code that relies on this though… They would almost certainly check for the zero in the denominator rather than the return value.</div> <div><br></div> </div> <div id="CanarySig"> <div> <div style="font-family:Helvetica;color:#000;font-size:13px;">Best Regards,<div>Hameer Abbasi</div></div> <div><br></div> </div> </div> <div id="CanaryDropbox"> </div> <blockquote id="CanaryBlockquote"> <div> <div>On Tuesday, Jan 08, 2019 at 6:57 PM, Tyler Reddy <<a href="mailto:tyler.je.reddy@gmail.com">tyler.je.reddy@gmail.com</a>> wrote:<br></div> <div><div dir="ltr">We are now at the stage of implementing the timedelta64 divmod inner loop given very recent additions of floordiv and remainder inner loops for this data type. However, there is some contention about a previous decision regarding modulus behavior that we'd like to resolve before we bake it in to divmod.<br><br>Currently, a modulus operation with two timedelta64 operands with a 0 denominator returns 0. For example:<br><br>np.timedelta64(5) % np.timedelta64(0) -> numpy.timedelta64(0)<br><br>In contrast, np.float64(1) % np.float64(0) -> nan<br><br>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.<br><br>Do we have consensus on this?<br><br>Ref: <a href="https://github.com/numpy/numpy/pull/12683">https://github.com/numpy/numpy/pull/12683</a><br><br>Thanks!<br>Tyler</div> _______________________________________________ <br>NumPy-Discussion mailing list <br>NumPy-Discussion@python.org <br>https://mail.python.org/mailman/listinfo/numpy-discussion <br></div> </div> </blockquote> <img id="D701AAB4B4F2DDF2BAB3E8CD50931FC0" width="1px" src="http://pixels.canarymail.io:8100/track/977C99C0645380AF45E168B4CDA443F5_D701AAB4B4F2DDF2BAB3E8CD50931FC0.png" height="1px"></body></html>