IDiv
@param ValueProxy $val
@return Int
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() );
	}
663113
protected function Div( $val )
	{
		if  (! $val->getIsNumeric() ) return $this;
		$value1 = $this->ToDecimal( null );
		$value2 = $val->ToDecimal( null );
		return $value1->Div( $value2 );
	}
651961
public static int intVal(String val, int defaultValue) {
        try {
            return NumberUtils.createNumber(val).intValue();
        } catch (Exception e) {
            log.warn("intVal(String, int) throw {}, return defaultValue = {}", e, defaultValue);
            return defaultValue;
        }
    }
1105059
public double setValue(int idx, double val) {
        int vSize = MVecArray.count(varBeliefs);
        if (idx < vSize) {
            return MVecArray.setValue(idx, val, varBeliefs);
        } else {
            return MVecArray.setValue(idx - vSize, val, facBeliefs);
        }
    }
1363339
protected function Promote( $val )
	{
		if ( ! $val instanceof ByteProxy ) throw new \InvalidArgumentException();
		return new ByteProxy( Convert::ToByte( $val->getValue(), null ) );
	}
696553
protected function Eq( $val )
	{
		if  (! $val->getIsNumeric() ) return false;
		return  $this->ToInt( null ) == $val->ToInt( null );
	}
764608
protected function dumpValue($val) : string
    {
        switch (true) {
            case is_string($val):
                return $this->dumpString($val);
            case is_array($val):
                return $this->dumpArray($val);
            case is_int($val):
                return $this->dumpInteger($val);
            case is_float($val):
                return $this->dumpFloat($val);
            case is_bool($val):
                return $this->dumpBool($val);
            case $val instanceof \Datetime:
                return $this->dumpDatetime($val);
            default:
                throw new DumpException("Data type not supporter at the key: \"{$this->currentKey}\".");
        }
    }
545486
public function dataToBinary($val)
    {
        $saved_object_count = $this->writtenObjectCount++;

        $bdata = self::typeBytes("4", strlen($val)); // a is 1000, type indicator for data
        $this->objectTable[$saved_object_count] = $bdata.$val;

        return $saved_object_count;
    }
1335396
protected function TryEq( $val, &$res )
	{
		$res = false;
		if ( ! $val instanceof ValueProxy ) return false;
		if ( $val->GetValueCode() != $this->GetValueCode() ) return false;

		$res = $this->Eq( $val );
		return true; // This SHOULD return true to indicate the comparison was successful
	}
93918
public double setValue(int idx, double val) {
        double prev = values[idx];
        values[idx] = val;
        return prev;
    }
1007333
protected function Mul($val)
	{
		$result = $this->_value->getValue() * $val->getValue()->getValue();
		return new LongProxy( new Long( $result ) );
	}
1286698
protected function Div($val)
	{
		$result = DecimalValue::FromValue( $this->_value )->Div( $val->getValue() );
		return new DecimalProxy( $result );
	}
995342
protected function validateCastValue($val)
    {
        if (isset($this->descriptor()->bareNumber) && $this->descriptor()->bareNumber === false) {
            return mb_ereg_replace('((^\D*)|(\D*$))', '', $val);
        } elseif (!is_numeric($val)) {
            throw $this->getValidationException('value must be numeric', $val);
        } else {
            $intVal = (int) $val;
            if ($intVal != (float) $val) {
                throw $this->getValidationException('value must be an integer', $val);
            } else {
                return $intVal;
            }
        }
    }
561953
public function val($val = null) {
		$val = (int) $val;
		if ($val) {
			if (is_numeric($val) && is_int($val*1)) {
				if (in_array($this->sources[$val],$this->sources)) {
					$this->val = $val;
					return $this->val;
				}
			} else {
				throw new \SimplOn\DataValidationException($this->valudationNaN);
			}
		} else {
			return $this->val;
		}
	}
1151314
protected function Div( $val )
	{
		if ( ! $val instanceof ValueProxy ) throw new \InvalidArgumentException();
		$numerator = Convert::ToDouble($this->_value);
		$denominator = Convert::ToDouble( $val->getValue() );

		if ( $denominator == 0 )
			throw XPath2Exception::withErrorCode( "FOAR0001", Resources::FOAR0001 );

		return new DecimalProxy( $numerator / $denominator );
	}
885975
public function getUserValue($val)
    {
        if ('' == $val) {
            return '';
        }

        if ($val instanceof PhpDateTime) {
            $date = $val;
            $date->setTimezone(new DateTimeZone($this->getSourceTimezone()));
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        } else {
            $date = PhpDateTime::createFromFormat(
                $this->getSourceDateTimeFormat(),
                $val,
                new DateTimeZone($this->getSourceTimezone())
            );
            if (false === $date) {
                return '';
            }
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        }
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            $this->getOutputDateType(),
            $this->getOutputTimeType(),
            $this->getOutputTimezone(),
            IntlDateFormatter::GREGORIAN,
            $this->getOutputPattern()
        );

        return $formatter->format($date->getTimestamp());
    }
753021
protected function getValueType($val)
    {
        $type = 'String';
        if ($this->auto_convert_types === true && is_numeric($val)) {
            $type = 'Number';
        }

        return $type;
    }