Ethiopian multiplication: Difference between revisions

no edit summary
(Forth, multiply step from colorForth)
No edit summary
Line 252:
}
}</lang>
 
=={{header|Logo}}==
<lang logo>
to double :x
output ashift :x 1
end
to halve :x
output ashift :x -1
end
to even? :x
output equal? 0 bitand 1 :x
end
to eproduct :x :y
if :x = 0 [output 0]
ifelse even? :x ~
[output eproduct halve :x double :y] ~
[output :y + eproduct halve :x double :y]
end
</lang>
 
=={{header|Metafont}}==
Implemented without the ''tutor''.
Anonymous user