diff options
| author | kennytm <kennytm@gmail.com> | 2017-12-22 02:50:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-22 02:50:57 +0800 |
| commit | b60e6f82855d387c0ad98179c33e6c019e8a7d26 (patch) | |
| tree | 0f1f55dec1349f8a450bb83f442207695ea70b6a /src/libstd | |
| parent | 8acc406cf619f4aa2db4bbf1158f1090ff4278fe (diff) | |
| parent | 9d6bd0536aed290f4fe80b42820fcf2463d2f8b3 (diff) | |
| download | rust-b60e6f82855d387c0ad98179c33e6c019e8a7d26.tar.gz rust-b60e6f82855d387c0ad98179c33e6c019e8a7d26.zip | |
Rollup merge of #46898 - tspiteri:int-overflow-not-underflow, r=steveklabnik
docs: do not call integer overflows as underflows In the API docs, integer overflow is sometimes called underflow. Underflow is really when the magnitude of a floating-point number is too small so the number underflows to subnormal or zero. With integers it is always overflow, even if the expected result is less than the minimum number that can be represented.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/buffered.rs | 2 | ||||
| -rw-r--r-- | src/libstd/time/duration.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 6d3fbc9d268..8308ab48d9c 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -263,7 +263,7 @@ impl<R: Seek> Seek for BufReader<R> { /// See `std::io::Seek` for more details. /// /// Note: In the edge case where you're seeking with `SeekFrom::Current(n)` - /// where `n` minus the internal buffer length underflows an `i64`, two + /// where `n` minus the internal buffer length overflows an `i64`, two /// seeks will be performed instead of one. If the second seek returns /// `Err`, the underlying reader will be left at the same position it would /// have if you seeked to `SeekFrom::Current(0)`. diff --git a/src/libstd/time/duration.rs b/src/libstd/time/duration.rs index a74e8a21c42..15ddb62bab5 100644 --- a/src/libstd/time/duration.rs +++ b/src/libstd/time/duration.rs @@ -290,7 +290,7 @@ impl Duration { } /// Checked `Duration` subtraction. Computes `self - other`, returning [`None`] - /// if the result would be negative or if underflow occurred. + /// if the result would be negative or if overflow occurred. /// /// [`None`]: ../../std/option/enum.Option.html#variant.None /// |
