Anonymous user
Roots of a function: Difference between revisions
m
→{{header|Lua}}: tidying
m (→{{header|Lua}}: removed needless initialisation) |
m (→{{header|Lua}}: tidying) |
||
Line 1,359:
function f (x) return x^3 - 3*x^2 + 2*x end
--
function root (f, start, stop, step)
local roots, x, sign, foundExact, value = {}, start, f(start) > 0
|