1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 08:59:01 +00:00

Avoid NaN return from formulas.mean_stddev when array has only 1 element

This commit is contained in:
dmiller
2016-10-24 20:17:07 +00:00
parent 39449f767f
commit d4fd11fc91

View File

@@ -136,7 +136,9 @@ function mean_stddev(t)
local i, m, s, sigma
if #t == 0 then
return 0, nil
return nil, nil
elseif #t == 1 then
return t[1], 0
end
m = t[1]