title: Own calc in windows command line
body: <p>I wrote a code to calculate some expressions. It works like this:<code>calc 5+  6 + 8*7</code> must output 67.
  The problem that I faced is bitwise operators:<code>calc 1 ^&amp; 0</code> gives error. Idea of my calc is simple. First stick all our input together in <code>set a</code> and then <code>set /A a=%a%</code> to calculate the expression
  My code:</p>
  
  <pre><code>@echo off
  if "%1" == "" goto :help
  if "%1" == "/?" goto :help
  
  set "g="
  
  :start
  rem ***Stick all our input together*** 
  set "g=%g%%1"
  if not "%1" == "" (
  if "%1" == "/?" (
      goto :help
      )
  shift
  goto :start 
  )
  
  echo %g%| findstr /R "[^0123456789\+\-\*\/\(\)] \+\+ \-\- \*\* \/\/ \= \=\= \^^"  &gt;nul 2&gt;&amp;1
  if not ERRORLEVEL 1 goto error
  
  set /A "g=%g%" 2&gt;nul
  if ERRORLEVEL 1 goto error
  
  echo %g%
  set g=
  goto :EOF
  
  :help
  echo This is simple calculator
  echo Usage: Mycalc.cmd [/?] (EXPRESSION)
  echo Available operands:+,-,*,/,(,)
  goto :EOF
  
  :error
  echo Wrong input or calculation error.
  </code></pre>
  
  <p>I think that the problem when we enter <code>calc 1 ^&amp; 0</code> there is error to <code>echo %g%</code>: <code>0 is not recognized as an internal or external command</code> </p>