The I Function: Decode (Base Value )
Monadic (One-Argument) Form
There is no monadic form.
Dyadic (Two-Argument) Form: Decode AIB
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):
1. 0 1. 0 :I. 0 :I. I1 .I. :I. ‘7 ‘7 6
The following illustration shows how it was done:
Argument A (number system) specifies the following:
10 10 10 10
-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:
The result is the same as doing the following:
6= 6 The units position always represents itself.
700 \The value in the next position is multiplied
7 x10 = 70
7 xlOxl0 =
I x10x10x10= 1000 by the rightmost value in argument A.
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.
If either argument A or B is not a scalar, they both must have the same length, or
an error results.
Mote: The value of the leftmost position of argument A can be
zero, because even
though there must be a value in that position, it is not used when calculating the
result. For example:
0 J. il I. (1 :I. [I .I. 1. '7 '7 6
s. 7 7 d>
If either argument is a scalar, the value of that argument is repeated to match the
length of the other:
'7 "7 '7
If argument A is a vector and argument B is a matrix, argument A must have an
element for each row of 6:
If argument A is a matrix and argument B is a vector, each row of argument A is a
separate conversion factor; argument B must be the same length as a row of
argument A. The result will be a vector with one element for each row of
argument A:
Previous Page Next Page