The function f described in the arguments section is evaluated, as f x in the
monadic case or as y f x in the dyadic case. Indeed, although the two infix forms
are shown for definiteness, f{...} is evaluated for any valence of f, zero through nine.
Warning! If instead of a function scalar you give a function expression, (e.g., instead of (+;-;«)[1]¡x or (<{f})¡x you give -¡x or f¡x), you will get a wrong result, namely, the result for the Each operator.
The Bitwise operator applies Not to each bit of the argument and applies all the other functions except Cast to each pair of corresponding bits of the arguments.
The derived function Bitwise Not is a monadic scalar function and all the others except Bitwise Cast are dyadic scalar functions, obeying the usual rules of conformability.
Examples for Bitwise Not, And, and Unequal
~® ¢16 15 ¢123 122
15 ¢16 122 ¢123 ã One's complement.
5 ^® É10
0 1 0 1 4 5 4 5 0 1
5 ¨® É10
5 4 7 6 1 0 3 2 13 12
And and Or, without the Bitwise operator, give boolean results for all valid arguments - see above.
Bitwise Cast ©®x
Bitwise Cast leaves the data part of the variable unchanged but changes the type indicator and (usually) shape. The conversion of symbol to character, for example, is quite different from plain Cast: for a symbol, the data part is a four-byte pointer, which may differ from process to process but is guaranteed unique and invariant within a process. The data part of a character is, of course, its ASCII code.
The left argument can be `int, `float, or `char; a Bitwise Cast to `sym is not allowed since not all integers are valid symbols, i.e., not all point to symbols. The type of the right argument can be of any of the four.
Since scalars of various types are represented using various numbers of bytes, the length of the last dimension of the result may differ from that of the right argument. There is no padding or truncation. If rb bytes are required to represent the result type and ab to represent the right argument type and rb>ra, then the last dimension of the right argument must be divisible by rbßab. The table below exhibits the relation between the shape of the right argument and that of the result.
The rank is changed only when a scalar is cast bitwise to a type that is represented in fewer bytes.