Arithmetic/Integer: Difference between revisions

Content added Content deleted
(FALSE)
m (→‎{{header|Tcl}}: comment about using braces in expr command)
Line 623: Line 623:
puts "
puts "
$x + $y = [expr $x+$y]
$x + $y = [expr {$x + $y}]
$x - $y = [expr $x-$y]
$x - $y = [expr {$x - $y}]
$x * $y = [expr $x*$y]
$x * $y = [expr {$x * $y}]
$x / $y = [expr int($x / $y)]
$x / $y = [expr {int($x / $y)}]
$x mod $y = [expr $x % $y]
$x mod $y = [expr {$x % $y}]
"
"


Line 636: Line 636:
incr x $y
incr x $y


Also, it's important to surround the arguments to the <code>expr</code> in braces. Discussion is [http://wiki.tcl.tk/10225 here].
etc


=={{header|Toka}}==
=={{header|Toka}}==