Skip to content

Commit 964ba2a

Browse files
author
Robin Kruppe
committed
Fix bug in rustc_apfloat
1 parent 0d6b52c commit 964ba2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_apfloat/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ pub trait Float
378378
fn from_bits(input: u128) -> Self;
379379
fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self> {
380380
if input < 0 {
381-
Self::from_u128_r(-input as u128, -round).map(|r| -r)
381+
Self::from_u128_r(input.wrapping_neg() as u128, -round).map(|r| -r)
382382
} else {
383383
Self::from_u128_r(input as u128, round)
384384
}

0 commit comments

Comments
 (0)