op_IntegerDivide
@param ValueProxy $val1
@param ValueProxy $val2
@return Integer
518712
public static function op_IntegerDivide( $val1, $val2 )
	{
		switch ( ValueProxy::$conv_t[ $val1->GetValueCode() ][ $val2->GetValueCode() ] )
		{
			case -1:
				return $val2->Promote( $val1 )->IDiv( $val2 );

			case 0:
				return $val1->IDiv( $val2 );

			case 1:
				return $val1->IDiv( $val1->Promote( $val2 ) );

			default:
				if ( ValueProxy::$conv_t[ $val2->GetValueCode() ][ $val1->GetValueCode() ] == 1 )
					return $val2->Promote( $val1 )->IDiv( $val2 );

				throw XPath2Exception::withErrorCodeAndParams( "XPTY0004", Resources::BinaryOperatorNotDefined,
					array(
						"op:idiv",
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $val1 ), XmlTypeCardinality::One ),
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $val2 ), XmlTypeCardinality::One )
					)
				);
		}
	}
164782
protected function IDiv( $val )
	{
		if  (! $val->getIsNumeric() ) return $this;
		$value2 = $val->ToDouble( null );
		return Integer::FromValue( $this->ToDecimal( null )->Div( $val->ToDecimal( null ) )->getIntegerPart() );
	}
457042
public function bitOr( $value1, $value2 )
    {
        $value1 = $this->getIdentifier( $value1 );
        $value2 = $this->getIdentifier( $value2 );
        return "( {$value1} | {$value2} )";
    }
1011187
protected function Mod( $val )
	{
		$val = $this->getOtherValue( $val );

		if ( is_infinite( $this->_value ) || is_nan( $this->_value ) || is_nan( $val ) || $val == 0 )
		{
			return new FloatProxy( NAN );
		}

		if ( is_infinite( $val ) )
		{
			return $this;
		}

		if ( is_infinite( $val ) )
		{
			return $val;
		}

		if ( $this->_value == 0 )
		{
			return $this;
		}

		$denominator = DecimalValue::FromFloat( $val );
		$result = DecimalValue::FromFloat( $this->_value )->Mod( $denominator );
		$result = $result->ToFloat( null );
		return new FloatProxy( $result );
	}
809554
protected function Mul( $val )
	{
		if  (! $val->getIsNumeric() ) return $this;

		$value1 = ValueProxy::Unwrap( $this );
		if ( $value1 instanceof Integer ) $value1 = $value1->getValue();
		$value2 = ValueProxy::Unwrap( $val );
		if ( $value2 instanceof Integer ) $value2 = $value2->getValue();
		return new IntegerProxy( Integer::FromValue( $value1 * $value2 ) );
	}
737966
public static function mul($int1, $int2)
    {
        if (!static::is($int1) || !static::is($int2)) {
            throw new \InvalidArgumentException("The \$int1 and \$int2 parameters must be of type int.");
        }

        return ($int1 * $int2);
    }
368751
public static int safeMultiply(int val1, int val2) {
        long total = (long) val1 * (long) val2;
        if (total < Integer.MIN_VALUE || total > Integer.MAX_VALUE) {
          throw new ArithmeticException("Multiplication overflows an int: " + val1 + " * " + val2);
        }
        return (int) total;
    }
230399
private function getMinInConfiguration($val1, $val2)
    {
        if ($val1 && $val2) {
            return min(array($val1, $val2));
        }
        if ($val1) {
            return $val1;
        }
        if ($val2) {
            return $val2;
        }

        return null;
    }
1355215
public static double mul(Double v1, Double v2) {
		return mul((Number) v1, (Number) v2).doubleValue();
	}
1337135
function replace(val1, val2) {
      var l = last.call(this);
      l.replacePartial1 = val1;
      l.replacePartial2 = val2;
      return this;
    }
1007333
protected function Mul($val)
	{
		$result = $this->_value->getValue() * $val->getValue()->getValue();
		return new LongProxy( new Long( $result ) );
	}
426497
public function bitAnd( $value1, $value2 )
    {
        $value1 = $this->getIdentifier( $value1 );
        $value2 = $this->getIdentifier( $value2 );
        return "( {$value1} & {$value2} )";
    }
302547
private function compareLong($value1, $value2, $operator)
    {
        switch ($operator) {
            case FieldExpression::EQUALS:
                return $value1 === $value2;

            case FieldExpression::NOT_EQUALS:
                return $value1 !== $value2;

            case FieldExpression::GT:
                return $value1 > $value2;

            case FieldExpression::LT:
                return $value1 < $value2;
        }

        $errMsg = 'unknown field operator';
        throw new InvalidArgumentException($errMsg);
    }
303978
public static function compare($val1, $val2)
    {
        if(in_array(self::getQualifiedType($val1), array('int','boolean', 'float', 'NULL')) )
            return $val1 == $val2 ? 0 : (($val1 < $val2) ? -1 : 1);
        // if(self::getQualifiedType($val1) == 'string' )
            // return strcmp($val1, $val2);
        if(self::isSubclass($val1, 'Date'))
            return self::compare($val1->toUnix(), $val2->toUnix());

        return strcmp((string)$val1, (string)$val2);
    }
1244334
public static function div($int1, $int2)
    {
        if (!static::is($int1) || !static::is($int2)) {
            throw new \InvalidArgumentException("The \$int1 and \$int2 parameters must be of type int.");
        }

        if ($int2 == 0) {
            throw new \InvalidArgumentException("Cannot divide by zero. The \$int2 parameter cannot be zero.");
        }

        return ($int1 / $int2);
    }
24301
protected function Sub( $val )
	{
		$result = $this->_value->getValue() - $val->getValue()->getValue();
		return new LongProxy( new Long( $result ) );
	}
1061973
protected function Promote( $val )
	{
		if ( ! $val instanceof ValueProxy ) throw new \InvalidArgumentException();
		return new IntProxy( Convert::ToInt32( $val->getValue() ) );
	}