2

Tracking Issue for `#![feature(mixed_integer_ops)]` · Issue #87840 · rust-lang/r...

 2 years ago
source link: https://github.com/rust-lang/rust/issues/87840
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Contributor

a1phyr commented on Aug 7, 2021

edited

Feature gate: #![feature(mixed_integer_ops)]

Public API

// `uX` is `u8`, `u16`, `u32`, `u64`,`u128`, `usize`
impl uX {
    pub const fn checked_add_signed(self, iX) -> Option<Self>;
    pub const fn overflowing_add_signed(self, iX) -> (Self, bool);
    pub const fn saturating_add_signed(self, iX) -> Self;
    pub const fn wrapping_add_signed(self, iX) -> Self;
}

impl iX {
    pub const fn checked_add_unsigned(self, uX) -> Option<Self>;
    pub const fn overflowing_add_unsigned(self, uX) -> (Self, bool);
    pub const fn saturating_add_unsigned(self, uX) -> Self;
    pub const fn wrapping_add_unsigned(self, uX) -> Self;

    pub const fn checked_sub_unsigned(self, uX) -> Option<Self>;
    pub const fn overflowing_sub_unsigned(self, uX) -> (Self, bool);
    pub const fn saturating_sub_unsigned(self, uX) -> Self;
    pub const fn wrapping_sub_unsigned(self, uX) -> Self;
}

Steps / History

joshsleeper, KevinMGranger, newAM, mwerezak, lukechu10, sap1l, ricvelozo, CGMossa, sffc, agersant, and 7 more reacted with thumbs up emojiMinusGix, droogmic, smmalis37, mwillsey, ModProg, AdamBlance, ian-h-chamberlain, Bear-03, andrusha, osa1, and 27 more reacted with heart emoji All reactions

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK