summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--absl/time/time.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/absl/time/time.h b/absl/time/time.h
index 01b55322..89b1b2af 100644
--- a/absl/time/time.h
+++ b/absl/time/time.h
@@ -187,7 +187,12 @@ class Duration {
Duration& operator%=(Duration rhs);
// Overloads that forward to either the int64_t or double overloads above.
- // Integer operands must be representable as int64_t.
+ // Integer operands must be representable as int64_t. Integer division is
+ // truncating, so values less than the resolution will be returned as zero.
+ // Floating-point multiplication and division is rounding (halfway cases
+ // rounding away from zero), so values less than the resolution may be
+ // returned as either the resolution or zero. In particular, `d / 2.0`
+ // can produce `d` when it is the resolution and "even".
template <typename T, time_internal::EnableIfIntegral<T> = 0>
Duration& operator*=(T r) {
int64_t x = r;