LinuxShell算术运算

使用let 命令
加法:
n=10
let n=n+1
echo $n #n=11

乘法:
let m=n*10
echo $m

除法:
let r=m/10
echo $r


求余数:
let r=m%7
echo $r


乘�纾�


let r=m**2


echo $r

http://www.cppblog.com/fwxjj/archive/2009/09/04/95342.html

 

你可能感兴趣的:(linux,shell,职场,休闲,算术运算)