Enhance documentation about absl::Duration integer division, which
truncates, and floating-point multiplication/division, which rounds.
PiperOrigin-RevId: 517016481
Change-Id: I3b0c357ea7236f2c0231df5e6b47c742c3f40047
diff --git a/absl/time/time.h b/absl/time/time.h
index 01b5532..89b1b2a 100644
--- a/absl/time/time.h
+++ b/absl/time/time.h
@@ -187,7 +187,12 @@
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;