public static void modulo(Decimal128 left, Decimal128 right, Decimal128 result,
       short scale) {

     // set result to x / p (the quotient)
     Decimal128.divide(left, right, result, scale);

     // take integer part of it
     result.zeroFractionPart();

     // multiply by p
     result.multiplyDestructive(right, scale);

     // negate it
     result.negateDestructive();

     // add x to it
     result.addDestructive(left, scale);
   }
Performs decimal modulo
<p>
The definition of modulo (x % p) is:
  x - IntegerPart(x / p, resultScale) * p
</p>

@param left
   is x
@param right
   is p
@param result
   receives the result
@param scale
   scale of result
common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java