On Mon, 2024-06-10 at 10:49 +0300, Matti Picus wrote: > What operating system? > > > If I recall correctly, NumPy tries to be compatible with CPython for > these edge cases. >
Right, and there seems nothing odd here to me. Try using `divmod()` on a few numbers (not infinities) to realize that this is how Python defines things. Python modulo is not identical to IEEE modulo as describd in the docs. - Sebastian > > The actual implementation is a bit scattered. I think it would be > nice > if we could have an "explain" decorator to ufuncs that would return > the > name of the inner loop used in practice to aid in debugging and > teaching. Until then your best bet is to build NumPy locally with > debug > information and use a debugger, but even that can be challenging at > times. > > Matti > > > On 07/06/2024 21:10, jesse.live...@gmail.com wrote: > > Hi all, > > > > I ran into an odd edge-case with np.mod and was wondering if this > > is the expected behavior, and if so why. This is on a fresh install > > of python 3.10.14 with numpy 1.26.4 from conda-forge. > > ... > > Any ideas why these are the return values? I had a hard time > > tracking down where in the numpy source np.mod was coming from. > > Jesse > > _______________________________________________ > > NumPy-Discussion mailing list -- numpy-discussion@python.org > > To unsubscribe send an email to numpy-discussion-le...@python.org > > https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ > > Member address: matti.pi...@gmail.com > > https://github.com/numpy/numpy/blob/main/numpy/_core/src/umath/loops_modulo.dispatch.c.src#L557 > _______________________________________________ > NumPy-Discussion mailing list -- numpy-discussion@python.org > To unsubscribe send an email to numpy-discussion-le...@python.org > https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ > Member address: sebast...@sipsolutions.net > _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com