MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / hashnum

Function hashnum

Source/Misc/lua/src/lua.c:9324–9332  ·  view source on GitHub ↗

** hash for lua_Numbers */

Source from the content-addressed store, hash-verified

9322** hash for lua_Numbers
9323*/
9324static Node *hashnum (const Table *t, lua_Number n) {
9325unsigned int a[numints];
9326int i;
9327if (luai_numeq(n, 0)) /* avoid problems with -0 */
9328return gnode(t, 0);
9329memcpy(a, &n, sizeof(a));
9330for (i = 1; i < numints; i++) a[0] += a[i];
9331return hashmod(t, a[0]);
9332}
9333
9334
9335

Callers 2

mainpositionFunction · 0.85
luaH_getnumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected