Changes

no edit summary
Line 19: Line 19:  
     local q = tonumber(frame.args[3])
 
     local q = tonumber(frame.args[3])
 
     if a and b and q then
 
     if a and b and q then
         return string.format("%.f", log(1 - q) / log(1 - a / b))
+
         return string.format("%.f", log(1 - q / 100) / log(1 - a / b))
 
     else
 
     else
 
         return "undefined"
 
         return "undefined"
Line 33: Line 33:  
         local p = a / b
 
         local p = a / b
 
         local se = math.sqrt(p * (1 - p) / b)
 
         local se = math.sqrt(p * (1 - p) / b)
         return string.format("%." .. f .. "f", 100 * pc * se)
+
         return string.format("%." .. f .. "f", 100 * (pc * se + 0.5 / b))
 
     else
 
     else
 
         return "undefined"
 
         return "undefined"
cssedit, gkautomate
6,928

edits