Ethiopian multiplication: Difference between revisions
Content added Content deleted
(Little correction.) |
|||
Line 1,333: | Line 1,333: | ||
protected function __construct($x, $y){ |
protected function __construct($x, $y){ |
||
while($x > 1){ |
while($x >= 1){ |
||
$this->sum_result($x, $y); |
$this->sum_result($x, $y); |
||
$x = $this->half_num($x); |
$x = $this->half_num($x); |
||
$y = $this->double_num($y); |
$y = $this->double_num($y); |
||
} |
} |
||
$this->sum_result($x, $y); |
|||
} |
} |
||