Ethiopian multiplication: Difference between revisions

Content added Content deleted
Line 626: Line 626:
throw new Exception("muliplier cannot be negative");
throw new Exception("muliplier cannot be negative");
}
}
static int doubleNum(int n) { return n * 2; }
int doubleNum(int n) { return n * 2; }
static int halveNum(int n) { return n / 2; }
int halveNum(int n) { return n / 2; }
static bool isEven(int n) { return !(n % 2); }
bool isEven(int n) { return !(n % 2); }


int result;
int result;