Ethiopian multiplication: Difference between revisions

(→‎{{header|Objeck}}: Marked incomplete as functions to halve and double are missing.)
Line 1,859:
 
=={{header|Objeck}}==
{{incomplete|Objeck|Functions to halve and double are missing.}}
{{trans|Java}}
<lang objeck>
Line 1,880 ⟶ 1,879:
sum := isEven(first)? 0 : second;
do {
first := halveInt(first >> 1);
second := doubleInt(second << 1);
if(isEven(first) = false){
sum += second;
Line 1,889 ⟶ 1,888:
return sum;
}
function : halveInt(num : Int) ~ Bool {
return num >> 1;
}
 
function : doubleInt(num : Int) ~ Bool {
return num << 1;
}
760

edits