@@ -3,7 +3,7 @@ use core::{fmt, mem, ops};
33use super :: int_traits:: { CastFrom , Int , MinInt } ;
44
55/// Trait for some basic operations on floats
6- #[ allow( dead_code) ]
6+ // #[allow(dead_code)]
77pub trait Float :
88 Copy
99 + fmt:: Debug
@@ -84,11 +84,13 @@ pub trait Float:
8484 fn to_bits ( self ) -> Self :: Int ;
8585
8686 /// Returns `self` transmuted to `Self::SignedInt`
87+ #[ allow( dead_code) ]
8788 fn to_bits_signed ( self ) -> Self :: SignedInt {
8889 self . to_bits ( ) . signed ( )
8990 }
9091
9192 /// Check bitwise equality.
93+ #[ allow( dead_code) ]
9294 fn biteq ( self , rhs : Self ) -> bool {
9395 self . to_bits ( ) == rhs. to_bits ( )
9496 }
@@ -98,6 +100,7 @@ pub trait Float:
98100 ///
99101 /// This method returns `true` if two NaNs are compared. Use [`biteq`](Self::biteq) instead
100102 /// if `NaN` should not be treated separately.
103+ #[ allow( dead_code) ]
101104 fn eq_repr ( self , rhs : Self ) -> bool {
102105 if self . is_nan ( ) && rhs. is_nan ( ) { true } else { self . biteq ( rhs) }
103106 }
@@ -117,6 +120,7 @@ pub trait Float:
117120 }
118121
119122 /// Returns if `self` is subnormal.
123+ #[ allow( dead_code) ]
120124 fn is_subnormal ( self ) -> bool {
121125 ( self . to_bits ( ) & Self :: EXP_MASK ) == Self :: Int :: ZERO
122126 }
@@ -132,15 +136,11 @@ pub trait Float:
132136 }
133137
134138 /// Returns the significand with no implicit bit (or the "fractional" part)
139+ #[ allow( dead_code) ]
135140 fn frac ( self ) -> Self :: Int {
136141 self . to_bits ( ) & Self :: SIG_MASK
137142 }
138143
139- /// Returns the significand with implicit bit.
140- fn imp_frac ( self ) -> Self :: Int {
141- self . frac ( ) | Self :: IMPLICIT_BIT
142- }
143-
144144 /// Returns a `Self::Int` transmuted back to `Self`
145145 fn from_bits ( a : Self :: Int ) -> Self ;
146146
@@ -154,22 +154,25 @@ pub trait Float:
154154 )
155155 }
156156
157+ #[ allow( dead_code) ]
157158 fn abs ( self ) -> Self ;
158159
159160 /// Returns a number composed of the magnitude of self and the sign of sign.
161+ #[ allow( dead_code) ]
160162 fn copysign ( self , other : Self ) -> Self ;
161163
162164 /// Returns (normalized exponent, normalized significand)
165+ #[ allow( dead_code) ]
163166 fn normalize ( significand : Self :: Int ) -> ( i32 , Self :: Int ) ;
164167
165168 /// Returns a number that represents the sign of self.
169+ #[ allow( dead_code) ]
166170 fn signum ( self ) -> Self {
167171 if self . is_nan ( ) { self } else { Self :: ONE . copysign ( self ) }
168172 }
169173}
170174
171175/// Access the associated `Int` type from a float (helper to avoid ambiguous associated types).
172- #[ allow( dead_code) ]
173176pub type IntTy < F > = <F as Float >:: Int ;
174177
175178macro_rules! float_impl {
0 commit comments