A calculator as a list of numbers and operators Your task is to take a list of arguments that are either integers or operators, and parse them like so:


There is a current operator, which starts as +.
Each time an operator is found, the current operator will change to it.
The possible operators are: "+", "-", "*", "/", and "%", which correspond to their meanings in C and most languages.
There is a running solution kept, which starts at 0.
Each time an integer is found, the solution is modified by the number depending on the operator; e.g. if the operator is "/" then the solution is divided by the number.
If an operation would result in a mixed number (i.e. with a decimal) then it must be floored back to an integer (i.e. the decimal must be chopped off).
Output the final solution.


For example:

The arguments 5 8 25 * 9 6 2 - 104 / 4 7 + 6 % 14 would result in:

  5 8  25 * 9   6    2    - 104  / 4    7      + 6 % 14
0 5 13 38   342 2052 4104   4000   1000 142   148    8  -&gt; 8


The inputs will be as command-line or function arguments, or an equivalent for your language.

Shortest code wins!
JavaScript (ES6) 53

A function taking an array as input.

Run the snippet in Firefox to test.



f=a=&gt;a.map(t=&gt;t&lt;'0'?o=t:v=eval(v+o+t)|0,v=0,o='+')&amp;&amp;v

// TEST
out=x=&gt;O.innerHTML=x;

input = [5,8,25,"*",9,6,2,"-",104,"/",4,7,"+",6,"%",14];
out(input.join(' ')+' -&gt; '+f(input));

function go() {
  i=I.value.split(/ +/),out(I.value+' -&gt; '+f(i))
}  
&lt;pre id=O&gt;&lt;/pre&gt;
Your test:&lt;input id=I&gt;&lt;button onclick='go()'&gt;GO&lt;/button&gt;