Repository navigation
Tracking Issue for int_roundings #88581
Description
Activity
- addedC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
on Sep 2, 2021 - added a commit that references this issue
on Sep 2, 2021 Just updated to the latest nightly, looks like this feature breaks the num-bigint crate.
error[E0658]: use of unstable library feature 'int_roundings'
error[E0658]: use of unstable library feature 'int_roundings' --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint.rs:398:45 | 398 | let root_scale = extra_bits.div_ceil(&n64); | ^^^^^^^^ | = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information = help: add `#![feature(int_roundings)]` to the crate attributes to enable error[E0308]: mismatched types --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint.rs:398:54 | 398 | let root_scale = extra_bits.div_ceil(&n64); | ^^^^ expected `u64`, found `&u64` | help: consider removing the borrow | 398 - let root_scale = extra_bits.div_ceil(&n64); 398 + let root_scale = extra_bits.div_ceil(n64); | error[E0658]: use of unstable library feature 'int_roundings' --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint/convert.rs:70:10 | 70 | .div_ceil(&big_digit::BITS.into()) | ^^^^^^^^ | = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information = help: add `#![feature(int_roundings)]` to the crate attributes to enable error[E0308]: mismatched types --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint/convert.rs:70:19 | 70 | .div_ceil(&big_digit::BITS.into()) | ^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found reference | = note: expected type `u64` found reference `&_` help: consider removing the borrow | 70 - .div_ceil(&big_digit::BITS.into()) 70 + .div_ceil(big_digit::BITS.into()) | error[E0658]: use of unstable library feature 'int_roundings' --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint/convert.rs:585:10 | 585 | .div_ceil(&u64::from(bits)) | ^^^^^^^^ | = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information = help: add `#![feature(int_roundings)]` to the crate attributes to enable error[E0308]: mismatched types --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint/convert.rs:585:19 | 585 | .div_ceil(&u64::from(bits)) | ^^^^^^^^^^^^^^^^ expected `u64`, found `&u64` | help: consider removing the borrow | 585 - .div_ceil(&u64::from(bits)) 585 + .div_ceil(u64::from(bits)) | error[E0658]: use of unstable library feature 'int_roundings' --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint/convert.rs:613:10 | 613 | .div_ceil(&u64::from(bits)) | ^^^^^^^^ | = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information = help: add `#![feature(int_roundings)]` to the crate attributes to enable error[E0308]: mismatched types --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint/convert.rs:613:19 | 613 | .div_ceil(&u64::from(bits)) | ^^^^^^^^^^^^^^^^ expected `u64`, found `&u64` | help: consider removing the borrow | 613 - .div_ceil(&u64::from(bits)) 613 + .div_ceil(u64::from(bits)) | Some errors have detailed explanations: E0308, E0658. For more information about an error, try `rustc --explain E0308`. error: could not compile `num-bigint` due to 8 previous errors warning: build failed, waiting for other jobs to finish... error: build failedReacted by Catena cyber, Darius Telyčėnas, Christos Papadopoulos, Hakim, casellimarco, Squirrel and Michael PfaffReacted by 1devNdogsThat is considered acceptable breakage. Per RFC 1105, adding an inherent impl is a minor change.
Reacted by Oscar Rainford, Christos Papadopoulos, kepexx, Ricardo Fernández Serrata and Ľubomír Kurčák- added 3 commits that reference this issue
on Sep 3, 2021 - added a commit that references this issue
on Sep 3, 2021 210 remaining items
Load more actions- added a commit that references this issue
on Sep 10, 2024 - added a commit that references this issue
on Sep 25, 2024 I am interested in this being fleshed out, so I surveyed the methods. The following division/remainder methods are not implemented. For ceiling and floored rounding, there is no
rem_*analogues todiv_*and none of the versions that control overflow and wrapping. Additionally, there is no Euclidean saturating division or any saturating remainders.rem_{ceil,floor}saturating_rem,saturating_{div,rem}_{ceil,euclid,floor}wrapping_{div,rem}_{ceil,floor}checked_{div,rem}_{ceil,floor}overflowing_{div,rem}_{ceil,floor}strict_{div,rem}_{ceil,floor}(Tracking Issue for arithmetic that panics on overflow (strict_*operations) #118260)
I maintain a document tracking rounding of division and modulo across languages, which may be a useful reference.
Reacted by Louis Maddox, Shaun Jackman, Nurzhan Saken, Lucky_Cat, may, Ray Redondo, Esteban Kuber and Hans BrendeIs there something that keeps this feature from being stabilized?
Reacted by Matthias Fauconneau, Ruifeng Xie, Sean Dewar and Zhan Rongrui@nxsaken I for one would strongly recommend we implement
rem_floorandrem_ceilas counterparts to thedivs. Especially becauserem_flooris the remainder you almost always want.Reacted by Nurzhan Saken, may and rktaxeThe signed methods are still unstable too.
While
prev_multiple_ofcan be emulated on signed types by passing a negative parameter, that option is not available for unsigned types. Having this method would be useful for e.g. value alignment and is also good API symmetry IMHO.Reacted by rktaxeWhile
prev_multiple_ofcan be emulated on signed types by passing a negative parameter, that option is not available for unsigned types. Having this method would be useful for e.g. value alignment and is also good API symmetry IMHO.Consider
unsigned_abs(), as ina.prev_multiple_of(b.unsigned_abs())- added a commit that references this issue
on Apr 30, 2026 - addedT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.and removedT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
on Aug 12, 2026 - added a commit that references this issue
on Sep 11, 2026
View all comments
Feature gate:
#![feature(int_roundings)]This is a tracking issue for the
div_floor,div_ceil,next_multiple_of, andchecked_multiple_ofmethods on all integer types.Public API
Steps / History
int_roundingsmethods from feedback #95359int_roundings#94455Unresolved Questions