@@ -70,10 +70,10 @@ pub(crate) trait Float:
7070 const EXPONENT_MASK : Self :: Int ;
7171
7272 /// Returns `self` transmuted to `Self::Int`
73- fn repr ( self ) -> Self :: Int ;
73+ fn to_bits ( self ) -> Self :: Int ;
7474
7575 /// Returns `self` transmuted to `Self::SignedInt`
76- fn signed_repr ( self ) -> Self :: SignedInt ;
76+ fn to_bits_signed ( self ) -> Self :: SignedInt ;
7777
7878 /// Checks if two floats have the same bit representation. *Except* for NaNs! NaN can be
7979 /// represented in multiple different ways. This method returns `true` if two NaNs are
@@ -93,10 +93,10 @@ pub(crate) trait Float:
9393 fn imp_frac( self ) -> Self :: Int ;
9494
9595 /// Returns a `Self::Int` transmuted back to `Self`
96- fn from_repr ( a: Self :: Int ) -> Self ;
96+ fn from_bits ( a: Self :: Int ) -> Self ;
9797
9898 /// Constructs a `Self` from its parts. Inputs are treated as bits and shifted into position.
99- fn from_parts( sign : bool , exponent: Self :: Int , significand: Self :: Int ) -> Self ;
99+ fn from_parts( negative : bool , exponent: Self :: Int , significand: Self :: Int ) -> Self ;
100100
101101 /// Returns (normalized exponent, normalized significand)
102102 fn normalize( significand: Self :: Int ) -> ( i32 , Self :: Int ) ;
@@ -124,10 +124,10 @@ macro_rules! float_impl {
124124 const IMPLICIT_BIT : Self :: Int = 1 << Self :: SIGNIFICAND_BITS ;
125125 const EXPONENT_MASK : Self :: Int = !( Self :: SIGN_MASK | Self :: SIGNIFICAND_MASK ) ;
126126
127- fn repr ( self ) -> Self :: Int {
127+ fn to_bits ( self ) -> Self :: Int {
128128 self . to_bits( )
129129 }
130- fn signed_repr ( self ) -> Self :: SignedInt {
130+ fn to_bits_signed ( self ) -> Self :: SignedInt {
131131 self . to_bits( ) as Self :: SignedInt
132132 }
133133 fn eq_repr( self , rhs: Self ) -> bool {
@@ -137,8 +137,8 @@ macro_rules! float_impl {
137137 // necessary builtin (__unordtf2) to test whether `f128` is NaN.
138138 // FIXME(f16_f128): Remove once the nightly toolchain has the __unordtf2 builtin
139139 // x is NaN if all the bits of the exponent are set and the significand is non-0
140- x. repr ( ) & $ty:: EXPONENT_MASK == $ty:: EXPONENT_MASK
141- && x. repr ( ) & $ty:: SIGNIFICAND_MASK != 0
140+ x. to_bits ( ) & $ty:: EXPONENT_MASK == $ty:: EXPONENT_MASK
141+ && x. to_bits ( ) & $ty:: SIGNIFICAND_MASK != 0
142142 }
143143 #[ cfg( not( feature = "mangled-names" ) ) ]
144144 fn is_nan( x: $ty) -> bool {
@@ -147,7 +147,7 @@ macro_rules! float_impl {
147147 if is_nan( self ) && is_nan( rhs) {
148148 true
149149 } else {
150- self . repr ( ) == rhs. repr ( )
150+ self . to_bits ( ) == rhs. to_bits ( )
151151 }
152152 }
153153 fn is_sign_negative( self ) -> bool {
@@ -162,12 +162,12 @@ macro_rules! float_impl {
162162 fn imp_frac( self ) -> Self :: Int {
163163 self . frac( ) | Self :: IMPLICIT_BIT
164164 }
165- fn from_repr ( a: Self :: Int ) -> Self {
165+ fn from_bits ( a: Self :: Int ) -> Self {
166166 Self :: from_bits( a)
167167 }
168- fn from_parts( sign : bool , exponent: Self :: Int , significand: Self :: Int ) -> Self {
169- Self :: from_repr (
170- ( ( sign as Self :: Int ) << ( Self :: BITS - 1 ) )
168+ fn from_parts( negative : bool , exponent: Self :: Int , significand: Self :: Int ) -> Self {
169+ Self :: from_bits (
170+ ( ( negative as Self :: Int ) << ( Self :: BITS - 1 ) )
171171 | ( ( exponent << Self :: SIGNIFICAND_BITS ) & Self :: EXPONENT_MASK )
172172 | ( significand & Self :: SIGNIFICAND_MASK ) ,
173173 )
@@ -182,7 +182,7 @@ macro_rules! float_impl {
182182 )
183183 }
184184 fn is_subnormal( self ) -> bool {
185- ( self . repr ( ) & Self :: EXPONENT_MASK ) == Self :: Int :: ZERO
185+ ( self . to_bits ( ) & Self :: EXPONENT_MASK ) == Self :: Int :: ZERO
186186 }
187187 }
188188 } ;
0 commit comments