mirror of
https://github.com/nmap/nmap.git
synced 2026-08-29 04:53:24 +00:00
Avoid NaN return from formulas.mean_stddev when array has only 1 element
This commit is contained in:
parent
39449f767f
commit
d4fd11fc91
1 changed files with 3 additions and 1 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue