Lua:byteTableToFloat

From Cheat Engine
Revision as of 15:48, 25 June 2026 by Leunsel (talk | contribs) (Syntax Highlighting.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<> Lua API Reference

function byteTableToFloat(Table) : Number

Converts a table of bytes to a single precision (32-bit) floating point number.

Function Parameters

Parameter Type Description
Table Table A table containing the bytes to convert (least significant byte first).

Returns

Number — The resulting single precision floating point value.

Explanation

The function takes a table of bytes (e.g., {0xC3, 0xF5, 0x48, 0x40}) and interprets them as a 32-bit float in little-endian order.

For example, byteTableToFloat({0xC3, 0xF5, 0x48, 0x40}) returns 3.14.

Examples

1 local floatValue = byteTableToFloat({0xC3, 0xF5, 0x48, 0x40})
2 print(floatValue) -- Output: 3.14

Main Pages

Core Lua documentation entry points

Lua
Script Engine