title: How does the computer read this code? I am trying to get factorial '!' to bind more tightly than the others
body: <p>I tried taking the factorial "implementation" up and down but <code>*</code> (multiplication)  and <code>/</code> (division) always comes before it. For example, if I enter <code>2*3!</code>, I want the computer to read <code>2*(3!)</code> <em>not</em> <code>(2*3)!</code>. The computer produces <code>(2*3)!</code></p>
  
  <p>I have tried switching (up and down the code) where the factorial is  but that is not doing the trick.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>switch (t.kind) {
      case '!': {
          double d = left;
          left = 1;
          double limit = d;
          for (int i = 0; i &lt; limit; ++i) {
              left *= d;
              d = d - 1;
          }
          t = ts.get();
          break;
      }
      case '/': {
          double d = primary();
          if (d == 0) error("division by zero");
          left /= d;
          t = ts.get();
          break;
      }
      case '*':
          left *= primary();
          t = ts.get();
          break;
      default:
          ts.putback(t);
          return left;
      }
  }
  </code></pre>