Wednesday, May 10, 2006

Command Line Calculator ...

I wasn't aware that DOS has an in-built calculator in it till yesterday morning. Ok based on my understaning I have written the following ... hope this info would be of some help to you!!

DOS Shell has a built in mini calculator to perform mathematical calculation.


Syntax for SET command: Set /a Your_Expression_Comes_here

As you would be knowing, type set /? to display the complete help of that command. Btw, this supports "SHIFT" operators (both left <<>>).

Try it yourself:

Step1: Open the command prompt (Start >> Run >> cmd)
Step 2: Find below the screenshot which shows few examples I have tried myself.

i) 10<<2 means 10 x ( 2 to the power of 2)
i.e., 10 x 4 = 40

ii) 40>>2 means, 40 / ( 2 to the power of 2)
i.e., 40 / 4 = 10

Hope this helps!

1 comment:

Anonymous said...

you might want to try following: