Chromium Code Reviews| Index: sdk/lib/core/duration.dart |
| diff --git a/sdk/lib/core/duration.dart b/sdk/lib/core/duration.dart |
| index a0cf1b601b64238d20732a84d79b2e1aa9d1f188..5d56e19b6977ad35b94c7fcc0e3dfd2fc3f1f859 100644 |
| --- a/sdk/lib/core/duration.dart |
| +++ b/sdk/lib/core/duration.dart |
| @@ -56,7 +56,7 @@ class Duration implements Comparable<Duration> { |
| int minutes: 0, |
| int seconds: 0, |
| int milliseconds: 0, |
| - int microseconds: 0}) |
| + int microseconds: 0}) |
|
floitsch
2013/06/25 15:28:02
Remove trailing space.
zarah
2013/06/25 15:54:05
Done.
|
| : _duration = days * MICROSECONDS_PER_DAY + |
| hours * MICROSECONDS_PER_HOUR + |
| minutes * MICROSECONDS_PER_MINUTE + |
| @@ -82,9 +82,12 @@ class Duration implements Comparable<Duration> { |
| /** |
| * Multiplies this [Duration] by the given [factor] and returns the result |
| * as a new [Duration]. |
| + * |
| + * Note when [factor] is a double, and the duration is greater than |
|
floitsch
2013/06/25 15:28:02
Note that ...
or:
Note: ...
zarah
2013/06/25 15:54:05
Done.
|
| + * 53 bits, precision is lost because of double-precision arithmetic. |
| */ |
| - Duration operator *(int factor) { |
| - return new Duration(microseconds: _duration * factor); |
| + Duration operator *(num factor) { |
| + return new Duration(microseconds: (_duration * factor).round()); |
| } |
| /** |