⊤
Encode r←[x]⊤y
If x
is not provided, it defaults to the scalar 2
.
If x
is non-scalar, operates on vectors of x
and scalars of y
, the following recursive procedure is performed:
- let
b
be⊇x
andbs
be¯1↓x
- let
rem
beb=0⍰y⍠b|y
anddiv
beb=0⍰0⍠⌊y÷b
r
isrem⍪⍨bs⊤div
If x
is scalar, operates on vectors of y
, x
must have magnitude greater than 1
and the following recursive procedure is performed:
- if
y=0
, thenr
is⟨⟩
- let
rem
bex|y
anddiv
be⌊y÷x
- let
rem1
bex|div
anddiv1
be⌊div÷x
- if
rem=rem1
anddiv=div1
thenr
isy
- otherwise
r
isrem⍪⍨x⊤div
with the difference that encoding 0
returns ⟨0⟩
instead of ⟨⟩
.