mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fixed use of abs instead of fabs
Some compilers choose the integer version when scope is not explicit, changed to fabs for clarity sake.
This commit is contained in:
@@ -222,7 +222,7 @@ class XPace : public RideMetric {
|
||||
else do {
|
||||
speed = (low + high)/2.0;
|
||||
double watts = running_power(weight, height, speed);
|
||||
if (abs(watts - lnp_watts) < 0.001) break;
|
||||
if (fabs(watts - lnp_watts) < 0.001) break;
|
||||
else if (watts < lnp_watts) low = speed;
|
||||
else if (watts > lnp_watts) high = speed;
|
||||
} while (high - low > 0.01);
|
||||
|
||||
@@ -60,7 +60,7 @@ VDOTCalculator::eqvTime(double VDOT, double dist)
|
||||
fprime_t = ((0.2989558*exp(-0.1932605*t) + 0.1894393*exp(-0.012778*t) + 0.8)*(-0.000208*pow(dist, 2)*pow(t,-3) - 0.182258*dist*pow(t, -2)) - ((0.000104*pow(dist, 2)*pow(t, -2) + 0.182258*dist*pow(t, -1) -4.6) * (-0.1932605*0.2989558*exp( -0.1932605*t) + -0.012778*0.1894393*exp(-0.012778*t)))) / pow(0.2989558*exp(-0.1932605*t) + 0.1894393*exp(-0.012778*t) + 0.8, 2);
|
||||
t -= f_t/fprime_t;
|
||||
iter--;
|
||||
} while (abs(f_t/fprime_t) > 1e-3 && iter > 0);
|
||||
} while (fabs(f_t/fprime_t) > 1e-3 && iter > 0);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user