/* Integer division; return 'm // n', that is, floor(m/n). C division truncates its result (rounds towards zero). 'floor(q) == trunc(q)' when 'q >= 0' or when 'q' is integer, otherwise 'floor(q) == trunc(q) - 1'.  */
lua_Integer luaV_div(lua_State *L, lua_Integer m, lua_Integer n)
/* Integer division; return 'm // n', that is, floor(m/n). C division truncates its result (rounds towards zero). 'floor(q) == trunc(q)' when 'q >= 0' or when 'q' is integer, otherwise 'floor(q) == trunc(q) - 1'.  */
lua_Integer luaV_div(lua_State *L, lua_Integer m, lua_Integer n)
{
    if (n == 0)
      luaG_runerror(L, "attempt to divide by zero");
    return intop(-, 0, m);
  }
  else {
    lua_Integer q = m / n;
    if ((m ^ n) < 0 && m % n != 0)
      q -= 1;
    return q;
  }
}