Skip to content

Commit cbd4630

Browse files
Rollup merge of rust-lang#145179 - joshtriplett:number, r=RalfJung
Avoid abbreviating "numerator" as "numer", to allow catching typo "numer" elsewhere `typos.toml` has an exception for "numer", to avoid flagging its use as an abbreviation for "numerator". Remove the use of that abbrevation, spelling out "numerator" instead, and remove the exception, so that typo checks can find future instances of "numer" as a typo for "number".
2 parents 65e9230 + 52751e9 commit cbd4630

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

std/src/sys_common/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@ pub trait FromInner<Inner> {
5151
fn from_inner(inner: Inner) -> Self;
5252
}
5353

54-
// Computes (value*numer)/denom without overflow, as long as both
55-
// (numer*denom) and the overall result fit into i64 (which is the case
56-
// for our time conversions).
54+
// Computes (value*numerator)/denom without overflow, as long as both (numerator*denom) and the
55+
// overall result fit into i64 (which is the case for our time conversions).
5756
#[allow(dead_code)] // not used on all platforms
58-
pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 {
57+
pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 {
5958
let q = value / denom;
6059
let r = value % denom;
6160
// Decompose value as (value/denom*denom + value%denom),
62-
// substitute into (value*numer)/denom and simplify.
63-
// r < denom, so (denom*numer) is the upper bound of (r*numer)
64-
q * numer + r * numer / denom
61+
// substitute into (value*numerator)/denom and simplify.
62+
// r < denom, so (denom*numerator) is the upper bound of (r*numerator)
63+
q * numerator + r * numerator / denom
6564
}
6665

6766
pub fn ignore_notfound<T>(result: crate::io::Result<T>) -> crate::io::Result<()> {

0 commit comments

Comments
 (0)