@Override
  protected double func(double v) {
    // if the outputType is a float cast the arguments to float to replicate the overflow behavior
    // in non-vectorized UDF GenericUDFPosMod
    if (isOutputTypeFloat) {
      float castedV = (float) v;
      float castedDivisor = (float) divisor;
      return ((castedV % castedDivisor) + castedDivisor) % castedDivisor;
    }
    // return positive modulo
    return ((v % divisor) + divisor) % divisor;
  }
Set type of the output column and also set the flag which determines if cast to float
is needed while calculating PosMod expression
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/PosModDoubleToDouble.java