From 515ea7157a55e5c870e4935f8560c8c3ccdbf9dd Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 14 Sep 2017 00:10:16 +0200 Subject: [PATCH] Use the newly added ONE constant in float addition --- library/compiler-builtins/src/float/add.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/compiler-builtins/src/float/add.rs b/library/compiler-builtins/src/float/add.rs index 2d380c13c265..e6cb726fd48d 100644 --- a/library/compiler-builtins/src/float/add.rs +++ b/library/compiler-builtins/src/float/add.rs @@ -1,5 +1,6 @@ use core::num::Wrapping; +use int::Int; use float::Float; /// Returns `a + b` @@ -7,8 +8,8 @@ macro_rules! add { ($a:expr, $b:expr, $ty:ty) => ({ let a = $a; let b = $b; - let one = Wrapping(1 as <$ty as Float>::Int); - let zero = Wrapping(0 as <$ty as Float>::Int); + let one = Wrapping(<$ty as Float>::Int::ONE); + let zero = Wrapping(<$ty as Float>::Int::ZERO); let bits = Wrapping(<$ty>::BITS as <$ty as Float>::Int); let significand_bits = Wrapping(<$ty>::SIGNIFICAND_BITS as <$ty as Float>::Int);