Ethiopian multiplication: Difference between revisions

m
→‎{{header|Bash}}: replaced mult and div with bitwise shifts so as to fit better with the spirit of the problem
(→‎{{header|Bash}}: added Bash solution)
m (→‎{{header|Bash}}: replaced mult and div with bitwise shifts so as to fit better with the spirit of the problem)
Line 259:
<lang bash>halve() {
local n=$1
echo -n $(( n />> 21 ))
}
 
double() {
local n=$1
echo -n $(( n *<< 21 ))
}