public static long scaleLargeTimestamp(long timestamp,long multiplier,long divisor){
  if (divisor >= multiplier && (divisor % multiplier) == 0) {
    long divisionFactor=divisor / multiplier;
    return timestamp / divisionFactor;
  }
 else   if (divisor < multiplier && (multiplier % divisor) == 0) {
    long multiplicationFactor=multiplier / divisor;
    return timestamp * multiplicationFactor;
  }
 else {
    double multiplicationFactor=(double)multiplier / divisor;
    return (long)(timestamp * multiplicationFactor);
  }
}

public static long scaleLargeTimestamp ( long timestamp , long multiplier , long divisor ) { if ( divisor >= multiplier && ( divisor % multiplier ) == 0 ) { long divisionFactor = divisor / multiplier ; return timestamp / divisionFactor ; } else if ( divisor < multiplier && ( multiplier % divisor ) == 0 ) { long multiplicationFactor = multiplier / divisor ; return timestamp * multiplicationFactor ; } else { double multiplicationFactor = ( double ) multiplier / divisor ; return ( long ) ( timestamp * multiplicationFactor ) ; } }
scales a large timestamp . < p > logically , scaling consists of a multiplication followed by a division . the actual operations performed are designed to minimize the probability of overflow .
