Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Windows (http://www.go4expert.com/articles/windows/)
-   -   Command Prompt Calculator (http://www.go4expert.com/articles/command-prompt-calculator-t5784/)

pradeep 10Aug2007 14:46

Command Prompt Calculator
 
The command processor CMD.EXE comes with a mini-calculator that can perform simple arithmetic on 32-bit signed integers:
Code:

C:\>set /a 2+2
4
C:\>set /a 2*(9/2)
8
C:\>set /a (2*9)/2
9
C:\>set /a "31>>2"
7

Note that we had to quote the shift operator since it would otherwise be misinterpreted as a "redirect stdout and append" operator.

For more information, type set /? at the command prompt.

shabbir 10Aug2007 19:10

Re: Command Prompt Calculator
 
I didn't know that. Interesting.


All times are GMT +5.5. The time now is 19:59.