-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
pub const fn saturating_div(self, rhs: u64) -> u64
This function will panic if rhs is 0.
This makes no sense. The only way that u64 / u64
could overfllow is if rhs = 0
.
The same is true for the other unsigned integer types. The signed types have the excuse that they wouldn't know whether to count division by zero as saturating to -ve or +ve maximum.
GrigorenkoPV, clubby789, zirconium-n, jieyouxu, Jules-Bertholet and 9 more
Metadata
Metadata
Assignees
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.