lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Oh *******!. That line should have been

while math.abs(g-f(g)) > epsilon do

in the definition of fixpoint. The moral is, if you actually want to understand
what you are doing rather than simply use a "package", then read up
on the Newton-Raphson method of finding fixpoints (Wikipedia is your friend),
read SICP (Structure and Interpretation of Computer Programs) by Abelson
and Sussman, who cover the whole business rather readably, and translate from
Scheme to Lua. That way you will avoid the stupid mistakes of dumbasses like me
and you will be doing yourself a favour, and perhaps enjoy yourself.

Gavin Wraith (
Home page: