summaryrefslogtreecommitdiff
path: root/test/bisect.lua
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2000-11-06 12:00:00 +0000
committerrepogen <>2000-11-06 12:00:00 +0000
commit8cb71cb5548e3138e5d4e4744f52c79d9fafb116 (patch)
tree25859eb162c67eafc46866e0ec3a9a7ebf93157a /test/bisect.lua
parentb7610da5fed99f59ac73ae452da8839a0f2c1bda (diff)
downloadlua-github-4.0.tar.gz
Lua 4.04.0
Diffstat (limited to 'test/bisect.lua')
-rw-r--r--test/bisect.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/bisect.lua b/test/bisect.lua
index 4de9e99b..9e1d8f70 100644
--- a/test/bisect.lua
+++ b/test/bisect.lua
@@ -18,9 +18,12 @@ function solve(f,a,b)
write(format("after %d steps, root is %.10g, f=%g\n",n,z,f(z)))
end
+-- an example
+
-- our function
function f(x)
return x*x*x-x-1
end
+-- find zero in [1,2]
solve(f,1,2)