Mercurial > pub > dyncall > bindings
annotate lua/luadyncall/test/test_intutils.lua @ 53:6387d39ecce2
- version bumps
author | Tassilo Philipp |
---|---|
date | Fri, 22 Jan 2021 15:18:56 +0100 |
parents | 0cfcc391201f |
children |
rev | line source |
---|---|
0 | 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 |