254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
return {
sz = c.sz;
name = string.format("%sfixed<%s,%s,%s>",
sign and 's' or 'u',
bits, base, prec
);
enc = function(v)
return c.enc(v)
end;
dec = function(s)
local v = c.dec(s)
return v / mul
end;
}
end
|
|
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
return {
sz = c.sz;
name = string.format("%sfixed<%s,%s,%s>",
sign and 's' or 'u',
bits, base, prec
);
enc = function(v)
return c.enc(v * mul)
end;
dec = function(s)
local v = c.dec(s)
return v / mul
end;
}
end
|