Fix false claim in comment.
Given that % and / have a defined consistency relation, neither is any better defined for -ve operands than the other. The code is in fact avoiding using -ve operands, not preferring "well-defined" / over (allegedly less so) %, as it claimed. Change-Id: I666690872f078c0f21f9af7a227c2bbf291704e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
0d14cdd30e
commit
e9b051f0ca
|
|
@ -1728,7 +1728,7 @@ QTime QTime::addMSecs(int ms) const
|
|||
QTime t;
|
||||
if (isValid()) {
|
||||
if (ms < 0) {
|
||||
// % not well-defined for -ve, but / is.
|
||||
// %,/ not well-defined for -ve, so always work with +ve.
|
||||
int negdays = (MSECS_PER_DAY - ms) / MSECS_PER_DAY;
|
||||
t.mds = (ds() + ms + negdays * MSECS_PER_DAY) % MSECS_PER_DAY;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue