code: static int inverseMod32(int val) {
          // Newton's iteration!
          int t = val;
          t *= 2 - val*t;
          t *= 2 - val*t;
          t *= 2 - val*t;
          t *= 2 - val*t;
          return t;
      }
docs: Returns the multiplicative inverse of val mod 2^32.  Assumes val is odd.