Jump to content

Nimber arithmetic: Difference between revisions

m
→‎{{header|Raku}}: Simplify, style tweaks
m (→‎{{header|Phix}}: 25*25 output)
m (→‎{{header|Raku}}: Simplify, style tweaks)
Line 715:
 
sub infix:<⊗> (Int $x, Int $y) {
return $x *× $y if so $x|$y < 2;
my $h = exp $x.lsb, 2;
return ($h ⊗ $y) ⊕ (($x ⊕ $h) ⊗ $y) if $x > $h;
return ($y ⊗ $x) if (exp $y.lsb, 2) < $y.msb;
return $x *× $y unless my $comp = $x.lsb +& $y.lsb;
$h = exp $comp.lsb, 2;
(($x +> $h) ⊗ ($y +> $h)) ⊗ (3 +< ($h - 1))
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.