[Positioner] sqrtf() instead of sqrt() with float

Use sqrtf() instead of sqrt() when returning a float.
master
Matteo Cypriani 10 years ago
parent 7e3b41a46f
commit 9d3c079b45

@ -167,13 +167,13 @@ inline float Measurement::get_variance_mw() const
inline float Measurement::get_std_deviation_mw() const
{
return sqrt(variance_mw) ;
return sqrtf(variance_mw) ;
}
inline float Measurement::get_std_deviation_dbm() const
{
return sqrt(variance_dbm) ;
return sqrtf(variance_dbm) ;
}

@ -98,9 +98,8 @@ double Point3D::angle_2d(const Point3D &b, const Point3D &c) const
if (sq_ab == 0 || sq_ac == 0 || sq_bc == 0)
return 0 ;
double
ab = sqrt(sq_ab),
ac = sqrt(sq_ac) ;
double ab = sqrt(sq_ab) ;
double ac = sqrt(sq_ac) ;
double cos_bac = (sq_ab + sq_ac - sq_bc) / (2 * ab * ac) ;
double bac = acos(cos_bac) ;

@ -194,7 +194,7 @@ inline void Point3D::set_coordinates(const Point3D &source)
*/
inline float Point3D::distance_2d(const Point3D &source) const
{
return sqrt(square_distance_2d(source)) ;
return sqrtf(square_distance_2d(source)) ;
}
@ -204,7 +204,7 @@ inline float Point3D::distance_2d(const Point3D &source) const
*/
inline float Point3D::distance(const Point3D &source) const
{
return sqrt(square_distance(source)) ;
return sqrtf(square_distance(source)) ;
}

Loading…
Cancel
Save