Fix warnings from LGTM

This fixes three LGTM warnings:

    Multiplication result may overflow 'float' before it is converted to 'double'.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2019-08-30 22:03:55 +02:00
parent 4a434809b0
commit fdf4067296

View File

@ -195,9 +195,9 @@ FCOORD LLSQ::mean_point() const {
double LLSQ::rms_orth(const FCOORD &dir) const {
FCOORD v = !dir;
v.normalise();
return std::sqrt(v.x() * v.x() * x_variance() +
2 * v.x() * v.y() * covariance() +
v.y() * v.y() * y_variance());
return std::sqrt(x_variance() * v.x() * v.x() +
2 * covariance() * v.x() * v.y() +
y_variance() * v.y() * v.y());
}
// Returns the direction of the fitted line as a unit vector, using the