comparison lua/luadyncall/test/test_intutils.lua @ 0:0cfcc391201f

initial from svn dyncall-1745
author Daniel Adler
date Thu, 19 Mar 2015 22:26:28 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0cfcc391201f
1 require "intutils"
2 u64 = intutils.u64
3 i64 = intutils.i64
4 local _print = print
5
6 local function print(x)
7 local mt = getmetatable(x)
8 local tostring = mt.__tostring
9 if tostring then
10 _print( tostring(x) )
11 else
12 _print(x)
13 end
14 end
15
16 x = u64("0x00FFFFFFFFFFFF00")
17 y = u64("0xCA000000000000FE")
18 z = x + y
19 print(x)
20 print(y)
21 print(z)
22
23 x = i64("0x00FFFFFFFFFFFF00")
24 y = i64("0xCA000000000000FE")
25 z = x + y
26 print(x)
27 print(y)
28 print(z)
29