Fix bug in rustc_apfloat
This commit is contained in:
parent
0d6b52c2f3
commit
964ba2a6e7
@ -378,7 +378,7 @@ pub trait Float
|
|||||||
fn from_bits(input: u128) -> Self;
|
fn from_bits(input: u128) -> Self;
|
||||||
fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self> {
|
fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self> {
|
||||||
if input < 0 {
|
if input < 0 {
|
||||||
Self::from_u128_r(-input as u128, -round).map(|r| -r)
|
Self::from_u128_r(input.wrapping_neg() as u128, -round).map(|r| -r)
|
||||||
} else {
|
} else {
|
||||||
Self::from_u128_r(input as u128, round)
|
Self::from_u128_r(input as u128, round)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user