mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Fix nan
This commit is contained in:
parent
1e78c6c720
commit
90400a1628
2 changed files with 12 additions and 5 deletions
|
|
@ -14,7 +14,11 @@ function format_utils.round(num, idp)
|
|||
return 0
|
||||
end
|
||||
|
||||
if math.abs(num) == math.huge then
|
||||
if num ~= num then -- nan (not a number)
|
||||
tprint("Number is nan")
|
||||
io.write(debug.traceback() .. "\n")
|
||||
res = 0
|
||||
elseif math.abs(num) == math.huge then
|
||||
-- This is an infinite, e.g., 1/0 or -1/0
|
||||
res = num
|
||||
-- elseif num == math.floor(num) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue