@@ -475,8 +475,8 @@ impl Fractional for float {
475
475
476
476
impl Algebraic for float {
477
477
#[ inline( always) ]
478
- fn pow ( & self , n : float ) -> float {
479
- ( * self as f64 ) . pow ( n as f64 ) as float
478
+ fn pow ( & self , n : & float ) -> float {
479
+ ( * self as f64 ) . pow ( & ( * n as f64 ) ) as float
480
480
}
481
481
482
482
#[ inline( always) ]
@@ -495,8 +495,8 @@ impl Algebraic for float {
495
495
}
496
496
497
497
#[ inline( always) ]
498
- fn hypot ( & self , other : float ) -> float {
499
- ( * self as f64 ) . hypot ( other as f64 ) as float
498
+ fn hypot ( & self , other : & float ) -> float {
499
+ ( * self as f64 ) . hypot ( & ( * other as f64 ) ) as float
500
500
}
501
501
}
502
502
@@ -532,8 +532,8 @@ impl Trigonometric for float {
532
532
}
533
533
534
534
#[ inline( always) ]
535
- fn atan2 ( & self , other : float ) -> float {
536
- ( * self as f64 ) . atan2 ( other as f64 ) as float
535
+ fn atan2 ( & self , other : & float ) -> float {
536
+ ( * self as f64 ) . atan2 ( & ( * other as f64 ) ) as float
537
537
}
538
538
539
539
/// Simultaneously computes the sine and cosine of the number
@@ -566,8 +566,8 @@ impl Exponential for float {
566
566
567
567
/// Returns the logarithm of the number with respect to an arbitrary base
568
568
#[ inline( always) ]
569
- fn log ( & self , base : float ) -> float {
570
- ( * self as f64 ) . log ( base as f64 ) as float
569
+ fn log ( & self , base : & float ) -> float {
570
+ ( * self as f64 ) . log ( & ( * base as f64 ) ) as float
571
571
}
572
572
573
573
/// Returns the base 2 logarithm of the number
0 commit comments