# Pastebin Y3uMXeF2 local sign,frac,exp=string.format("%a",v):match("(%-?)0x1%.?(%x-)p%+?([%d-]+)") exp = tonumber(exp, 16) frac = tonumber(frac, 16) local bOne = 0x00 if sign == "-" then bitOne = ba(bOne, 0x80) end bOne = bOne + ba(brs(exp, 1), 0xF8) local bTwo = ba(exp, 0x1F) bTwo = bTwo + ba(brs(frac, 50), 0x03) return sc(tsf.tags.DOUBLE) .. sc(bOne) .. sc(bTwo) .. encodeNumberToBytes(ba(frac, 0xFFFFFFFFFF), 6)