about summary refs log tree commit diff
path: root/src/libcore/num
diff options
context:
space:
mode:
authorLinus Färnstrand <faern@faern.net>2020-01-17 20:49:33 +0100
committerLinus Färnstrand <faern@faern.net>2020-01-23 20:55:06 +0100
commit9d257579fcaa44f69c8f7d5f668b05ae89e4507b (patch)
tree8b86d053621b81b0950be3190244f4f48210b3e4 /src/libcore/num
parent22dcfa1d8d18687d7ca0b91974bce4202d3383e9 (diff)
downloadrust-9d257579fcaa44f69c8f7d5f668b05ae89e4507b.tar.gz
rust-9d257579fcaa44f69c8f7d5f668b05ae89e4507b.zip
Fix some float operations to work together with the assoc consts
Diffstat (limited to 'src/libcore/num')
-rw-r--r--src/libcore/num/dec2flt/rawfp.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/num/dec2flt/rawfp.rs b/src/libcore/num/dec2flt/rawfp.rs
index a127c6c3fa7..0ab15b23e53 100644
--- a/src/libcore/num/dec2flt/rawfp.rs
+++ b/src/libcore/num/dec2flt/rawfp.rs
@@ -129,15 +129,15 @@ macro_rules! other_constants {
     ($type: ident) => {
         const EXPLICIT_SIG_BITS: u8 = Self::SIG_BITS - 1;
         const MAX_EXP: i16 = (1 << (Self::EXP_BITS - 1)) - 1;
-        const MIN_EXP: i16 = -Self::MAX_EXP + 1;
-        const MAX_EXP_INT: i16 = Self::MAX_EXP - (Self::SIG_BITS as i16 - 1);
+        const MIN_EXP: i16 = -<Self as RawFloat>::MAX_EXP + 1;
+        const MAX_EXP_INT: i16 = <Self as RawFloat>::MAX_EXP - (Self::SIG_BITS as i16 - 1);
         const MAX_ENCODED_EXP: i16 = (1 << Self::EXP_BITS) - 1;
-        const MIN_EXP_INT: i16 = Self::MIN_EXP - (Self::SIG_BITS as i16 - 1);
+        const MIN_EXP_INT: i16 = <Self as RawFloat>::MIN_EXP - (Self::SIG_BITS as i16 - 1);
         const MAX_SIG: u64 = (1 << Self::SIG_BITS) - 1;
         const MIN_SIG: u64 = 1 << (Self::SIG_BITS - 1);
 
-        const INFINITY: Self = $crate::$type::INFINITY;
-        const NAN: Self = $crate::$type::NAN;
+        const INFINITY: Self = $type::INFINITY;
+        const NAN: Self = $type::NAN;
         const ZERO: Self = 0.0;
     };
 }