We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31e286a commit 6c420acCopy full SHA for 6c420ac
2 files changed
vstruct/io/i.lua
@@ -24,6 +24,8 @@ function i.unpackbits(bit, width)
24
end
25
26
function i.pack(_, data, width)
27
+ data = math.trunc(data)
28
+
29
if data < 0 then
30
data = data + 2^(width*8)
31
vstruct/io/u.lua
@@ -32,6 +32,7 @@ end
32
function u.pack(_, data, width)
33
local s = ""
34
local e = io("endianness", "get")
35
36
37
for i=1,width do
38
if e == "big" then
0 commit comments