Search results

  1. R

    Feature - Implemented Initiative Calculations

    What could be more clear than this: { int a = ML * 0xCCCD; int b = a >>> 20; int c = (100-ML)>>31; int d = (b & ~c) | (5 & c); int e = d*(ML-(d<<3)-(d+d)-10); return e; }
  2. R

    Feature - Implemented Initiative Calculations

    I was taking the piss...other than there's no point in optimizing. You could do the following...but why? public static final int bar(int ML) { int x = ML / 20; if (x > 5) x = 5; return x*(ML-(x+1)*10); } (edit: My first post really should have used exp & log...
  3. R

    Feature - Implemented Initiative Calculations

    Ideally this function should only be called when +ML changes and the value cached. Thus the frequency of calling is statistically zero. Therefore clairity should trump speed. If you wanted to be anal, a simple speed up would be to convert it into divide and conq form. But even that make the...
Back
Top