Implement the div operator without using / or %
Anonymous
int divide(int m, int n) { int u, res = 0; bool neg = false; if (n == 0) return NaN; if (m = 0; k--) if (m >= n << k) m -= n << k, res += 1 << k; return neg ? -res : res; }
Check out your Company Bowl for anonymous work chats.