my table contains some big numbers, such as 1884882022.4
when I attempt to try and find the max value in the table using the code below, it reports 99997.1 as the maximum value, which is incorrect. Can someone explain why the code below doesn’t work for my data ?
function find_max( t )
if t == nil or type( t ) ~= ‘table’ then
return nil;
end
local max = t[1];
for k, v in pairs( t ) do
if( v > max ) then max = v; end
end
return max;
end [import]uid: 97524 topic_id: 19107 reply_id: 319107[/import]