Roots of a function: Difference between revisions

m
→‎{{header|Lua}}: removed needless initialisation
(→‎{{header|Lua}}: added code comments)
m (→‎{{header|Lua}}: removed needless initialisation)
Line 1,361:
-- Finds roots of f within range x=[start, stop] or approximations thereof
function root (f, start, stop, step)
local roots, x, sign, foundExact, value = {}, start, f(start) > 0, false
while x <= stop do
value = f(x)
Anonymous user