2929 * to produce the hexadecimal values shown.
3030 */
3131
32- use core:: f64;
33-
3432use super :: fabs;
3533
3634const ATANHI : [ f64 ; 4 ] = [
@@ -134,19 +132,19 @@ pub fn atan(x: f64) -> f64 {
134132
135133#[ cfg( test) ]
136134mod tests {
137- use core:: f64;
135+ use core:: f64:: consts ;
138136
139137 use super :: atan;
140138
141139 #[ test]
142140 fn sanity_check ( ) {
143141 for ( input, answer) in [
144- ( 3.0_f64 . sqrt ( ) / 3.0 , f64 :: consts:: FRAC_PI_6 ) ,
145- ( 1.0 , f64 :: consts:: FRAC_PI_4 ) ,
146- ( 3.0_f64 . sqrt ( ) , f64 :: consts:: FRAC_PI_3 ) ,
147- ( -3.0_f64 . sqrt ( ) / 3.0 , -f64 :: consts:: FRAC_PI_6 ) ,
148- ( -1.0 , -f64 :: consts:: FRAC_PI_4 ) ,
149- ( -3.0_f64 . sqrt ( ) , -f64 :: consts:: FRAC_PI_3 ) ,
142+ ( 3.0_f64 . sqrt ( ) / 3.0 , consts:: FRAC_PI_6 ) ,
143+ ( 1.0 , consts:: FRAC_PI_4 ) ,
144+ ( 3.0_f64 . sqrt ( ) , consts:: FRAC_PI_3 ) ,
145+ ( -3.0_f64 . sqrt ( ) / 3.0 , -consts:: FRAC_PI_6 ) ,
146+ ( -1.0 , -consts:: FRAC_PI_4 ) ,
147+ ( -3.0_f64 . sqrt ( ) , -consts:: FRAC_PI_3 ) ,
150148 ]
151149 . iter ( )
152150 {
@@ -167,12 +165,12 @@ mod tests {
167165
168166 #[ test]
169167 fn infinity ( ) {
170- assert_eq ! ( atan( f64 :: INFINITY ) , f64 :: consts:: FRAC_PI_2 ) ;
168+ assert_eq ! ( atan( f64 :: INFINITY ) , consts:: FRAC_PI_2 ) ;
171169 }
172170
173171 #[ test]
174172 fn minus_infinity ( ) {
175- assert_eq ! ( atan( f64 :: NEG_INFINITY ) , -f64 :: consts:: FRAC_PI_2 ) ;
173+ assert_eq ! ( atan( f64 :: NEG_INFINITY ) , -consts:: FRAC_PI_2 ) ;
176174 }
177175
178176 #[ test]
0 commit comments