Arithmetic/Integer: Difference between revisions
Content added Content deleted
(adding Yorick) |
(J: simplify) |
||
Line 653: | Line 653: | ||
=={{header|J}}== |
=={{header|J}}== |
||
<lang j>calc =: + , - , * , <.@% , |~ , ^ |
<lang j>calc =: + , - , * , <.@% , |~ , ^ |
||
labels =: |
labels =: ];.2 'Sum: Difference: Product: Quotient: Remainder: Exponentiation: ' |
||
combine =: |
combine =: ,. ":@,. |
||
bia =: labels combine calc</lang> |
bia =: labels combine calc</lang> |
||
Note that the verb <tt>calc</tt> produces all the processing specified for this problem, and that its output is of numeric type. |
Note that the verb <tt>calc</tt> produces all the processing specified for this problem, and that its output is of numeric type. |