>>
<<
Ndx
Usr
Pri
Phr
Dic
Rel
Voc
!:
wd
Help
Dictionary
u .. v « (u + u&v) % 2:
u .: v « (u - u&v) % 2:
|
In the most commonly used case, v is arithmetic negation,
and f=: u .. v is therefore f=: (u + u&-) % 2: ;
that is, one-half the sum of u y and u -y .
The resulting function is therefore even in the sense
that f y « f -y for any y;
its graph is reflected in the vertical axis. Similarly, u .: -
is odd (f y « -f-y), and its
graph is reflected in the origin. Less commonly, v is
matrix transpose (|:), and may
be any monadic function.
y=: _2 _1 0 1 2
1 2 3 4 5 & p. y Polynomial with odd and even terms
57 3 1 15 129
1 2 3 4 5 & p. .. - y Even part of polynomial
93 9 1 9 93
1 0 3 0 5 & p. y Polynomial with even terms only
93 9 1 9 93
E=: .. - Even adverb
O=: .: - Odd adverb
d=: 5j2&":@,.&.> Display as columns with two digits
d (5&o. ; ^O ; 6&o. ; ^E ; ^ ; (^E + ^O) ; 2&o. ; ^@j.E) y
+-----+-----+-----+-----+-----+-----+-----+-----+
|_3.63|_3.63| 3.76| 3.76| 0.14| 0.14|_0.42|_0.42|
|_1.18|_1.18| 1.54| 1.54| 0.37| 0.37| 0.54| 0.54|
| 0.00| 0.00| 1.00| 1.00| 1.00| 1.00| 1.00| 1.00|
| 1.18| 1.18| 1.54| 1.54| 2.72| 2.72| 0.54| 0.54|
| 3.63| 3.63| 3.76| 3.76| 7.39| 7.39|_0.42|_0.42|
+-----+-----+-----+-----+-----+-----+-----+-----+
m=: ?. 4 4 $ 9
(] ; (] .. |:) ; (] .: |:)) m
+-------+---------------+------------------+
|1 6 4 4| 1 3.5 6 2| 0 2.5 _2 2|
|1 0 6 6|3.5 0 4.5 3|_2.5 0 1.5 3|
|8 3 4 7| 6 4.5 4 5.5| 2 _1.5 0 1.5|
|0 0 4 6| 2 3 5.5 6| _2 _3 _1.5 0|
+-------+---------------+------------------+
>>
<<
Ndx
Usr
Pri
Phr
Dic
Rel
Voc
!:
wd
Help
Dictionary