Open
Description
Feature gate: #![feature(exact_div)]
This is a tracking issue for exact division methods (i.e. for division without remainder) on primitive integer types.
Public API
/// Checked integer division without remainder. Computes `self / rhs`,
/// returning `None` if `rhs == 0` or if division remainder is not zero.
pub const fn checked_exact_div(self, rhs: Self) -> Option<Self> { ... }
/// Integer division without remainder. Computes `self / rhs`,
/// panics if `rhs == 0` or if division remainder is not zero.
pub const fn exact_div(self, rhs: Self) -> Self { ... }
/// Integer division without remainder.
/// Unchecked version of `exact_div`.
pub unsafe const fn unchecked_exact_div(self, rhs: Self) -> Self { ... }
Steps / History
- ACP: Add
((un)checked_)exact_div
methods for integer types libs-team#337 - Implementation: TODO
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- Concerns over usefulness of the panicking
exact_div
: Add((un)checked_)exact_div
methods for integer types libs-team#337 (comment)