MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / b_shift

Function b_shift

src/Chain/libraries/glua/lbitlib.cpp:98–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97
98static int b_shift(lua_State *L, lua_Unsigned r, lua_Integer i) {
99 if (i < 0) { /* shift right? */
100 i = -i;
101 r = trim(r);
102 if (i >= LUA_NBITS) r = 0;
103 else r >>= i;
104 }
105 else { /* shift left */
106 if (i >= LUA_NBITS) r = 0;
107 else r <<= i;
108 r = trim(r);
109 }
110 pushunsigned(L, r);
111 return 1;
112}
113
114
115static int b_lshift(lua_State *L) {

Callers 3

b_lshiftFunction · 0.85
b_rshiftFunction · 0.85
b_arshiftFunction · 0.85

Calls 1

trimFunction · 0.50

Tested by

no test coverage detected