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
Edward Welbourne 2015-11-04 16:53:48 +01:00
parent 0d14cdd30e
commit e9b051f0ca
1 changed files with 1 additions and 1 deletions

View File

@ -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 {