Lua:doubleToByteTable
Jump to navigation
Jump to search
function doubleToByteTable(Number) : Table
Converts a double precision (64-bit) floating point number to a table of bytes.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| Number | Number | The double precision floating point value to convert. |
Returns
Table — A table containing the bytes representing the double.
Examples
local bytes = doubleToByteTable(3.1415926535)
for i, b in ipairs(bytes) do
print(string.format("Byte %d: %02X", i, b))
end
-- Output: 8 bytes representing the double in little-endian order
See also
| Lua |
| Script Engine |
Related Functions
| Read Functions |
|---|
| readBytes |
| readSmallInteger |
| readInteger |
| readQword |
| readPointer |
| readFloat |
| readDouble |
| readString |
| Read Functions (Local Process) |
| readBytesLocal |
| readIntegerLocal |
| readQwordLocal |
| readPointerLocal |
| readFloatLocal |
| readDoubleLocal |
| readStringLocal |
| Write Functions |
| writeBytes |
| writeSmallInteger |
| writeInteger |
| writeQword |
| writeFloat |
| writeDouble |
| writeString |
| Write Functions (Local Process) |
| writeBytesLocal |
| writeIntegerLocal |
| writeQwordLocal |
| writeFloatLocal |
| writeDoubleLocal |
| writeStringLocal |
| Byte Table Conversions (Value → Byte Table) |
| wordToByteTable |
| dwordToByteTable |
| qwordToByteTable |
| floatToByteTable |
| doubleToByteTable |
| stringToByteTable |
| wideStringToByteTable |
| Byte Table Conversions (Byte Table → Value) |
| byteTableToWord |
| byteTableToDword |
| byteTableToQword |
| byteTableToFloat |
| byteTableToDouble |
| byteTableToString |
| byteTableToWideString |