Roots of a function: Difference between revisions

m
m (→‎{{header|Lua}}: removed needless initialisation)
Line 1,359:
function f (x) return x^3 - 3*x^2 + 2*x end
 
-- FindsFind 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
Anonymous user