I observed a code clone from the following files. function : mpd_qdivint @ (file: "Python-3.3.0a2/Modules/_decimal/libmpdec/mpdecimal.c", line: 3727)~3763 function : mpd_qrem @ (file: "Python-3.3.0a2/Modules/_decimal/libmpdec/mpdecimal.c", line: 6331)~6361 The function mpd_qdivint checks the condition "mpd_isinfinite(a) && mpd_isinfinite(b)" while mpd_qrem does not. I wonder if this is necessary in mpd_qrem. The source code is included in the attachment. Hope it helps.
I can see why it is seems strange that // and % behave differently. If anything, I'd change divint to raise for things like inf // 3. But the official test cases don't: dvix601 divideint -Inf -1000 -> Infinity remx701 remainder -Inf -1000 -> NaN Invalid_operation Since decimal follows the specification (and the test cases), we can't change that. So I'm closing the issue.
History
Date
User
Action
Args
2022-04-11 14:57:31
admin
set
github: 59262
2012-06-14 07:50:18
skrah
set
status: open -> closedresolution: not a bugmessages: + stage: resolved