Skip to content

Commit

Permalink
std::math::big: fix and optimize to_i64 method of the Int struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Feb 27, 2024
1 parent 9bfdbf2 commit 9a78a33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions std/math/big/int.jule
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ impl Int {
if self.len() > 63 {
error(if self.neg { i64.MIN } else { i64.MAX })
}
let x = i64(self.nat.to_u64() else { error(error) })
let x = i64(u64_from_bits(self.nat.bits))
if self.neg {
ret -x
ret i64.MIN + x
}
ret x
}
Expand Down

0 comments on commit 9a78a33

Please sign in to comment.