Be explicit about expected type

This commit is contained in:
Tony Garnock-Jones 2019-07-04 05:47:32 -04:00
parent 681bb9705f
commit 04868a2309
1 changed files with 4 additions and 4 deletions

View File

@ -49,8 +49,8 @@ impl PartialEq for Float {
impl Ord for Float {
fn cmp(&self, other: &Self) -> Ordering {
let mut a = self.0.to_bits();
let mut b = other.0.to_bits();
let mut a: u32 = self.0.to_bits();
let mut b: u32 = other.0.to_bits();
if a & 0x80000000 != 0 { a ^= 0x7fffffff; }
if b & 0x80000000 != 0 { b ^= 0x7fffffff; }
(a as i32).cmp(&(b as i32))
@ -91,8 +91,8 @@ impl PartialEq for Double {
impl Ord for Double {
fn cmp(&self, other: &Self) -> Ordering {
let mut a = self.0.to_bits();
let mut b = other.0.to_bits();
let mut a: u64 = self.0.to_bits();
let mut b: u64 = other.0.to_bits();
if a & 0x8000000000000000 != 0 { a ^= 0x7fffffffffffffff; }
if b & 0x8000000000000000 != 0 { b ^= 0x7fffffffffffffff; }
(a as i64).cmp(&(b as i64))