Anonymous user
Ethiopian multiplication: Difference between revisions
→{{header|D}}
Line 623:
=={{header|D}}==
<lang d>int ethiopian(int n1, int n2) {
if (n1 < 0) {
throw new Exception("muliplier cannot be negative");
}
static int doubleNum(int n) { return n * 2; }
static int halveNum(int n) { return n / 2; }
|