-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
C-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-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.
Description
Feature gate: #![feature(signed_bigint_helpers)]
This issue continues discussion #85532 with the following methods on integers:
uN::carrying_mul_add_signediN::carrying_addiN::borrowing_subiN::carrying_muliN::carrying_mul_addiN::carrying_mul_add_unsigned
impl uN {
/// `add += self * rhs + carry`, covers full `i2N` range exactly
fn carrying_mul_add_signed(self, rhs: iN, carry: Self, add: iN) -> (Self, iN);
}
impl iN {
/// `self + rhs + carry`
fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool);
/// `self - rhs - carry`
fn borrowing_sub(self, rhs: Self, carry: bool) -> (Self, bool);
/// `self * rhs + carry`
fn carrying_mul(self, rhs: Self, carry: Self) -> (uN, Self);
/// `add += self * rhs + carry`, fits `i2N` range, but doesn't cover it fully
fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (uN, Self);
/// `add += self * rhs + carry`, covers full `i2N` range exactly
fn carrying_mul_add_unsigned(self, rhs: uN, carry: Self, add: uN) -> (uN, Self);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-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-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.