96
The
.L
Function: Decode
(Base
Value)
CD
Monadic (One-Argument) Form
There
is
no
monadic
form.
Dyadic (Two-Argument) Form: Decode
A.l
B
The
decode
function
result
is
the
value
of
argument
B expressed in
the
number
system specified by
argument
A.
For
example,
to
convert
1776
to
its value
in
the
decimal
number
system (base 10):
10
10
10
1011
7 7 6
1776
The
following illustration shows
how
it was done:
Argument
A
(number
system) specifies
the
following:
10 10
10
10
,L..--+.L...--..Lt-----'--Ten
units
in
each
of
these positions
equals one unit
of
the
next
position
to
the
left.
Argument B
is
a vector with these values:
7
7
6
The result
is
the
same as doing
the
following:
:1=
x10
=
x10x10
=
x10x10x10
=
6
The
units position always represents itself.
70
700
~~The
value
in
the
next
position
is
multiplied
1000
by
the
rightmost value
in
argument A.
1776
The
value
in
the
next
position
is
multiplied
by
the
two
rightmost values
in
argument A,
and so on.
The
arguments
must
be numeric. If
one
argument
is
a scalar or single-element array,
the
other
argument
can be a scalar, vector,
or
other
array.
The
result will have
the
rank
of
the
larger
argument
minus one.