int multiply(int a, int b) { if (a == 0 || b == 0) { return 0; } return aLogTbl[(logTbl[a] + logTbl[b]) % (size - 1)]; }