summaryrefslogtreecommitdiff
path: root/gpsprof
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-06 23:29:19 -0700
committerGary E. Miller <gem@rellim.com>2018-09-06 23:29:19 -0700
commit2f91452a5e58d0beb0a157c47e06970678fcefd2 (patch)
tree46457a57d637e93a38426281e81f9e4d27ff9212 /gpsprof
parent8d5d68758176d933be65aaaf2d983a6c7fd58990 (diff)
downloadgpsd-2f91452a5e58d0beb0a157c47e06970678fcefd2.tar.gz
gpsprof: Handle case where sigma is (near) zero.
Diffstat (limited to 'gpsprof')
-rwxr-xr-xgpsprof5
1 files changed, 3 insertions, 2 deletions
diff --git a/gpsprof b/gpsprof
index 1c99cf17..03b74253 100755
--- a/gpsprof
+++ b/gpsprof
@@ -185,8 +185,9 @@ class stats(object):
m4 += pow(fix - sigma, 4)
self.sigma = sigma
- self.skewness = m3 / (len(fixes) * pow(sigma, 3))
- self.kurtosis = m4 / (len(fixes) * pow(sigma, 4))
+ if sigma > 0.0001:
+ self.skewness = m3 / (len(fixes) * pow(sigma, 3))
+ self.kurtosis = m4 / (len(fixes) * pow(sigma, 4))
return