Anonymous user
Arithmetic/Integer: Difference between revisions
m
Spelling/grammar/aesthetics.
m (Alphabetized.) |
m (Spelling/grammar/aesthetics.) |
||
Line 136:
combine =: [ ,. ":@|:@,:@]
title =: >;.2 'Sum: Difference: Product: Quotient: Remainder: '
Note that the verb <tt>
=={{header|Java}}==
Line 297:
Since Tcl doesn't really know about the "type" of a variable, the "<tt>expr</tt>" command is used to declare whatever follows as an "expression". This means there is no such thing as "integer arithmetic" and hence the kludge <tt>int( $x / $y )</tt>.
Often, these operations would be performed in a
incr x $y
Line 328:
echo "a mod b = " `expr $a % $b`
(Notes: Using the ` (backtick operators, also
With SUSv3 parameter expansions:
Line 341:
echo "a mod b = $(($a%$b))"
(Note: spaces inside the ''$((...))'' are optional and not required; the ''$((...))'' expressions can be inside the double quotes
|