lunar_wave/lunar_wave_vm/test_vectors/fma.lua

27 lines
372 B
Lua
Raw Permalink Normal View History

-- This one fails :( I haven't implemented closures properly yet.
2023-09-28 05:55:16 +00:00
local ii = "bogus"
local function add (aa, bb)
return aa + bb
end
local function mul (cc, dd)
return cc * dd
end
local function fma (ee, ff, gg)
return add (mul (ee, ff), gg)
end
2023-09-28 05:55:16 +00:00
local function run ()
local hh = fma (10, 11, 12)
print (hh)
return hh
2023-09-28 05:55:16 +00:00
end
local hh = run ()
2023-09-28 05:55:16 +00:00
print (ii)
return hh