Sometimes when I’m playing on the computer, I suddenly want to calculate some numbers, I don’t want to open the mobile phone and use the APP on the mobile phone, and I don’t want to use the system's bulky calculator on the computer. I'm full of food. This is what I wrote this article. The original intention of the blog post is to use the terminal in Linux, doc and powershell under windows to implement simple mathematical operations.
One, Linux
echo $((2*3)) #计算整数类似于此,注意两个括号
echo 2.5*3.2|bc #计算浮点数
echo 2%3 | bc #取模
echo 2^8|bc #乘方
Two, Powershell
win+R powershell
2.5*3.2 #浮点数加减乘除
2.3%3 #取模
# 目前不知道乘方运算如何进行
Three, CMD
win+R cmd
set /a 3%2 #取模
set /a 3+2 #整数加减乘除,好像不可以浮点数。