We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74156a8 commit 552758eCopy full SHA for 552758e
library/core/src/time.rs
@@ -1317,7 +1317,8 @@ impl fmt::Debug for Duration {
1317
// need to perform rounding to match the semantics of printing
1318
// normal floating point numbers. However, we only need to do work
1319
// when rounding up. This happens if the first digit of the
1320
- // remaining ones is >= 5.
+ // remaining ones is > 5. When the first digit is exactly 5, rounding
1321
+ // follows IEEE-754 round-ties-to-even semantics.
1322
let integer_part = if fractional_part > 0 && fractional_part == divisor * 5 {
1323
let last_digit_is_odd = if pos > 0 {
1324
(buf[pos - 1] - b'0') % 2 == 1
0 commit comments