from_str_{binary,octal,hex} now rounds ties to even
This commit is contained in:
parent
1ba116110c
commit
b15a1e8ef0
616
src/from_str.rs
616
src/from_str.rs
File diff suppressed because it is too large
Load Diff
|
@ -42,6 +42,7 @@ where
|
|||
const ZERO: Self;
|
||||
|
||||
fn is_negative(self) -> bool;
|
||||
fn is_odd(self) -> bool;
|
||||
fn checked_add(self, val: Self) -> Option<Self>;
|
||||
fn checked_mul(self, val: Self) -> Option<Self>;
|
||||
fn overflowing_add(self, val: Self) -> (Self, bool);
|
||||
|
@ -114,6 +115,11 @@ macro_rules! sealed_int {
|
|||
false
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn is_odd(self) -> bool {
|
||||
self & 1 != 0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn neg_abs(self) -> (bool, Self::Unsigned) {
|
||||
(false, self)
|
||||
|
@ -177,6 +183,11 @@ macro_rules! sealed_int {
|
|||
self < 0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn is_odd(self) -> bool {
|
||||
self & 1 != 0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn neg_abs(self) -> (bool, Self::Unsigned) {
|
||||
if self < 0 {
|
||||
|
|
Loading…
Reference in New Issue