Skip to content

libscript-lua: use integer APIs of Lua 5.3 for script_get_int and script_put_int #2

@hishamhm

Description

@hishamhm

Lua 5.3 supports 64-bit integers. When building libscript-lua with Lua 5.3, script_get_int and script_put_int should send and receive 64-bit integers without losing precision. The library should continue to work with Lua 5.1/5.2 (if necessary, the code should be marked #if LUA_VERSION_NUM >= 503 so that it is used only in Lua 5.3).

A way to test that 64-bit integer support is working is that this number (2^53+3) should be sent to the script and retrieved without precision loss: 9007199254740995 (if this number is accidentally converted to a 64-bit float somewhere down the line it will lose one bit of precision and render as 9007199254740996).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions