Closed FilippoTrotter closed 1 month ago
This seems due to the combination of lua_Number
as type in output of lua_tointegerx
and the floorf
function (Could not find any documentation of it online 🤷).
Not totally sure why, but replacing lua_Number
to lua_Integer
and removing the floorf
function make it work as intended.
first draft fix here fix/oct_from_number
The O.from_number() method from the file src/zen_octet.c, used to convert an integer into octets, seems to not work correctly with sufficiently large numbers. Specifically, I've noticed the issue arises with numbers larger than 2^25.The problem appears with odd numbers. For example, the following test is passed by the function, which clearly should not happen.