code: @Override
      public AtomicValue operate(final AtomicValue mOperand1, final AtomicValue mOperand2)
          throws TTXPathException {
  
          final Type returnType = getReturnType(mOperand1.getTypeKey(), mOperand2.getTypeKey());
          final int typeKey = NamePageHash.generateHashForString(returnType.getStringRepr());
  
          final byte[] value;
  
          switch (returnType) {
          case DOUBLE:
          case FLOAT:
          case DECIMAL:
              final double dOp1 = Double.parseDouble(new String(mOperand1.getRawValue()));
              final double dOp2 = Double.parseDouble(new String(mOperand2.getRawValue()));
              value = TypedValue.getBytes(dOp1 % dOp2);
              break;
          case INTEGER:
              try {
                  final int iOp1 = (int)Double.parseDouble(new String(mOperand1.getRawValue()));
                  final int iOp2 = (int)Double.parseDouble(new String(mOperand2.getRawValue()));
                  value = TypedValue.getBytes(iOp1 % iOp2);
              } catch (final ArithmeticException e) {
                  throw new XPathError(ErrorType.FOAR0001);
              }
              break;
          default:
              throw new XPathError(ErrorType.XPTY0004);
  
          }
  
          return new AtomicValue(value, typeKey);
  
      }
docs: {@inheritDoc}