2007-09-04 01:52:33 +00:00
|
|
|
-- Clear out builtin math package
|
|
|
|
|
math = nil
|
|
|
|
|
|
2007-07-21 04:44:22 +00:00
|
|
|
local function autoload(table, key)
|
2007-09-04 01:52:33 +00:00
|
|
|
local chunk = loadfile(key..".luac")
|
2007-09-18 04:16:46 +00:00
|
|
|
local pkg = chunk()
|
|
|
|
|
table[key] = pkg
|
|
|
|
|
return pkg
|
2007-07-21 04:44:22 +00:00
|
|
|
end
|
|
|
|
|
|
2007-09-04 01:52:33 +00:00
|
|
|
setmetatable(_G, { __index = autoload } )
|
2007-07-21 04:44:22 +00:00
|
|
|
|
2007-09-04 01:52:33 +00:00
|
|
|
-- local result = math.sqrt(9.0)
|
|
|
|
|
-- print("x=", result)
|
2007-07-21 04:44:22 +00:00
|
|
|
print("square root of 9.0 is ", math.sqrt(9.0))
|
|
|
|
|
print("math.pi=", math.pi);
|