1
+ #[ cfg( any( feature = "approx" , feature = "random" ) ) ]
2
+ use core:: ops:: Mul ;
3
+
1
4
use core:: {
2
5
cmp:: PartialEq ,
3
- ops:: { Add , AddAssign , Mul , Sub , SubAssign } ,
6
+ ops:: { Add , AddAssign , Sub , SubAssign } ,
4
7
} ;
5
8
9
+ #[ cfg( feature = "approx" ) ]
6
10
use approx:: { AbsDiffEq , RelativeEq , UlpsEq } ;
7
11
8
12
#[ cfg( feature = "random" ) ]
@@ -14,13 +18,13 @@ use rand::{
14
18
Rng ,
15
19
} ;
16
20
21
+ #[ cfg( feature = "approx" ) ]
22
+ use crate :: { angle:: HalfRotation , num:: Zero } ;
23
+
17
24
#[ cfg( feature = "random" ) ]
18
25
use crate :: angle:: FullRotation ;
19
26
20
- use crate :: {
21
- angle:: { AngleEq , FromAngle , HalfRotation , RealAngle , SignedAngle , UnsignedAngle } ,
22
- num:: Zero ,
23
- } ;
27
+ use crate :: angle:: { AngleEq , FromAngle , RealAngle , SignedAngle , UnsignedAngle } ;
24
28
25
29
macro_rules! make_hues {
26
30
( $( $( #[ $doc: meta] ) + struct $name: ident; ) +) => ( $(
@@ -185,6 +189,7 @@ macro_rules! make_hues {
185
189
//
186
190
// The recommendation is use 180 * epsilon as the epsilon and do not compare by
187
191
// ulps. Because of this we loose some precision for values close to 0.0.
192
+ #[ cfg( feature = "approx" ) ]
188
193
impl <T > AbsDiffEq for $name<T >
189
194
where
190
195
T : RealAngle + SignedAngle + Zero + AngleEq <Mask = bool > + Sub <Output = T > + AbsDiffEq + Clone ,
@@ -206,6 +211,7 @@ macro_rules! make_hues {
206
211
}
207
212
}
208
213
214
+ #[ cfg( feature = "approx" ) ]
209
215
impl <T > RelativeEq for $name<T >
210
216
where
211
217
T : RealAngle + SignedAngle + Zero + AngleEq <Mask = bool > + Sub <Output = T > + Clone + RelativeEq ,
@@ -235,6 +241,7 @@ macro_rules! make_hues {
235
241
}
236
242
}
237
243
244
+ #[ cfg( feature = "approx" ) ]
238
245
impl <T > UlpsEq for $name<T >
239
246
where
240
247
T : RealAngle + SignedAngle + Zero + AngleEq <Mask = bool > + Sub <Output = T > + Clone + UlpsEq ,
0 commit comments