code: private static final long getNegDivMod(int number, int factor) 
      {
          int modulo = number % factor; 
          long result = number / factor;
          if (modulo < 0) { 
              -- result; 
              modulo += factor; 
          } 
          return (result << 32) | modulo;
      }
docs: Integer division and modulo with negative numerators
  yields negative modulo results and quotients that are one more than
  what we need here.
  @param number which operations are to be performed on
  @param factor the factor to use for division
  @return (result of division) << 32 | modulo