From 2d1df4714e2736dbde7855ddcd76b4c1de822fa5 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 23 Jan 2012 21:58:02 +1000 Subject: Added a big bunch of example lua scripts for testing the speed of lua compiling. --- .../testLua/yueliang-0.4.1/test_lua/5.1/bisect.lua | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 LuaSL/testLua/yueliang-0.4.1/test_lua/5.1/bisect.lua (limited to 'LuaSL/testLua/yueliang-0.4.1/test_lua/5.1/bisect.lua') diff --git a/LuaSL/testLua/yueliang-0.4.1/test_lua/5.1/bisect.lua b/LuaSL/testLua/yueliang-0.4.1/test_lua/5.1/bisect.lua new file mode 100644 index 0000000..f91e69b --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/test_lua/5.1/bisect.lua @@ -0,0 +1,27 @@ +-- bisection method for solving non-linear equations + +delta=1e-6 -- tolerance + +function bisect(f,a,b,fa,fb) + local c=(a+b)/2 + io.write(n," c=",c," a=",a," b=",b,"\n") + if c==a or c==b or math.abs(a-b)