mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Merge pull request #1232 from amtriathlon/master
Fixed NaN in xPower when there are no samples
This commit is contained in:
@@ -85,7 +85,7 @@ class XPower : public RideMetric {
|
||||
total += pow(weighted, 4.0);
|
||||
count++;
|
||||
}
|
||||
xpower = pow(total / count, 0.25);
|
||||
xpower = count ? pow(total / count, 0.25) : 0.0;
|
||||
secs = count * secsDelta;
|
||||
|
||||
setValue(xpower);
|
||||
|
||||
@@ -107,7 +107,7 @@ class XPowerSwim : public RideMetric {
|
||||
total += pow(weighted, 3.0);
|
||||
count++;
|
||||
}
|
||||
xpower = pow(total / count, 1/3.0);
|
||||
xpower = count ? pow(total / count, 1/3.0) : 0.0;
|
||||
secs = count * secsDelta;
|
||||
|
||||
setValue(xpower);
|
||||
|
||||
Reference in New Issue
Block a user