MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaK_intK

Function luaK_intK

extlibs/lua/src/lcode.c:592–597  ·  view source on GitHub ↗

** Add an integer to list of constants and return its index. ** Integers use userdata as keys to avoid collision with floats with ** same value; conversion to 'void*' is used only for hashing, so there ** are no "precision" problems. */

Source from the content-addressed store, hash-verified

590** are no "precision" problems.
591*/
592static int luaK_intK (FuncState *fs, lua_Integer n) {
593 TValue k, o;
594 setpvalue(&k, cast_voidp(cast_sizet(n)));
595 setivalue(&o, n);
596 return addk(fs, &k, &o);
597}
598
599/*
600** Add a float to list of constants and return its index.

Callers 2

luaK_intFunction · 0.85
luaK_exp2KFunction · 0.85

Calls 1

addkFunction · 0.85

Tested by

no test coverage detected