Neg
@return ValueProxy
426181
protected function Neg()
	{
	    throw XPath2Exception::withErrorCodeAndParams( "XPTY0004", Resources::UnaryOperatorNotDefined,
			array(
				"fn:unary-minus",
				SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $this->_value ), XmlTypeCardinality::One )
			)
		);
	}
102155
public function bitwiseNot()
    {
        // calculuate "not" without regard to $this->precision
        // (will always result in a smaller number. ie. ~1 isn't 1111 1110 - it's 0)
        $temp = $this->toBytes();
        $pre_msb = decbin(ord($temp[0]));
        $temp = ~ $temp;
        $msb = decbin(ord($temp[0]));
        if (strlen($msb) == 8) {
            $msb = substr($msb, strpos($msb, '0'));
        }
        $temp[0] = chr(bindec($msb));

        // see if we need to add extra leading 1's
        $current_bits = strlen($pre_msb) + 8 * strlen($temp) - 8;
        $new_bits = $this->precision - $current_bits;
        if ($new_bits <= 0) {
            return $this->protectedNormalize(new BigInteger($temp, 256));
        }

        // generate as many leading 1's as we need to.
        $leading_ones = chr((1 << ($new_bits & 0x7)) - 1) . str_repeat(chr(0xFF), $new_bits >> 3);
        $this->protectedBase256LShift($leading_ones, $current_bits);

        $temp = str_pad($temp, ceil($this->bits / 8), chr(0), STR_PAD_LEFT);

        return $this->protectedNormalize(new BigInteger($leading_ones | $temp, 256));
    }
163748
public function negated() : BigDecimal
    {
        return new BigDecimal(Calculator::get()->neg($this->value), $this->scale);
    }
815063
public BigDecimal negate() {
        if (intCompact == INFLATED) {
            return new BigDecimal(intVal.negate(), INFLATED, scale, precision);
        } else {
            return valueOf(-intCompact, scale, precision);
        }
    }
321981
public function negated() : Period
    {
        if ($this->isZero()) {
            return $this;
        }

        return new Period(
            - $this->years,
            - $this->months,
            - $this->days
        );
    }
1240462
public function negate() {
		$components = array();
		foreach($this->components as $index => $component) {
			$components[$index] = -$component;
		}

		$this->components = $components;
		return $this;
	}
152976
public function getFilteredValue() {
        if(!$this->getSanitizer() instanceof Sanitizer) {
            throw new \Exception('You have to assign a sanitizer first!');
        }
        
        return $this->getSanitizer()->filter($this->getRawValue());
    }
215201
public function cast($value)
    {
        if (isset($value) && !is_resource($value)) {
            return $this->dontCast($value);
        }
        
        return $value;
    }
232332
public function andNot()
    {
        $args = func_get_args();
        call_user_func_array(array($this, 'andAdd'), $args);

        $value = array_pop($this->conditions);
        $value->not();
        $this->add($value);

        return $this;
    }
66339
def copy_neg(self):
        
        result = mpfr.Mpfr_t.__new__(BigFloat)
        mpfr.mpfr_init2(result, self.precision)
        new_sign = not self._sign()
        mpfr.mpfr_setsign(result, self, new_sign, ROUND_TIES_TO_EVEN)
        return result
1996
public function valueObject($value, $exclude = false, $meaning = null)
    {
        switch (gettype($value)) {
            case 'boolean':
                $propertyValue = [
                    'booleanValue' => $value
                ];

                break;

            case 'integer':
                $propertyValue = [
                    'integerValue' => $value
                ];

                break;

            case 'double':
                $propertyValue = [
                    'doubleValue' => $value
                ];

                break;

            case 'string':
                $propertyValue = [
                    'stringValue' => $value
                ];

                break;

            case 'array':
                if (!empty($value) && $this->isAssoc($value)) {
                    $propertyValue = $this->convertArrayToEntityValue($value);
                } else {
                    $propertyValue = $this->convertArrayToArrayValue($value);
                }

                break;

            case 'object':
                $propertyValue = $this->objectProperty($value);
                break;

            case 'resource':
                $content = stream_get_contents($value);

                $propertyValue = [
                    'blobValue' => ($this->encode)
                        ? base64_encode($content)
                        : $content
                ];
                break;

            case 'NULL':
                $propertyValue = [
                    'nullValue' => null
                ];
                break;

            //@codeCoverageIgnoreStart
            case 'unknown type':
                throw new \InvalidArgumentException(sprintf(
                    'Unknown type for `%s',
                    $content
                ));
                break;

            default:
                throw new \InvalidArgumentException(sprintf(
                    'Invalid type for `%s',
                    $content
                ));
                break;
            //@codeCoverageIgnoreEnd
        }

        if ($exclude) {
            $propertyValue['excludeFromIndexes'] = true;
        }

        if ($meaning) {
            $propertyValue['meaning'] = $meaning;
        }

        return $propertyValue;
    }
1157770
protected function Sub( $val )
	{
		if ( ! $val instanceof ValueProxy ) throw new \InvalidArgumentException();
		return new IntProxy( $this->_value - $val->getValue() );
	}
628987
public function skip()
    {
        return !$this->present() ||
            ($this->filterEmpty() &&
                empty($this->_args[$this->name()]) &&
                !is_numeric($this->_args[$this->name()])
            );
    }
1103029
private static Number neg(Number n) 
  {
    switch (getType(n)) 
    {
      case INT :
        return new Integer(-n.intValue());
      case LONG :
        return new Long(-n.longValue());
      case FLOAT :
        return new Float(-n.floatValue());
      case DOUBLE :
        return new Double(-n.doubleValue());
      default :
        throw new IllegalStateException();
    }
  }
992672
public function inotn($width)
    {
        assert(is_integer($width) && $width >= 0);
        $neg = false;
        if( $this->isNeg() )
        {
            $this->negi();
            $neg = true;
        }

        for($i = 0; $i < $width; $i++)
            $this->bi = $this->bi->setbit($i, !$this->bi->testbit($i));

        return $neg ? $this->negi() : $this;
    }
479368
public function negative()
    {
        if (!is_int($this->value) && !is_float($this->value)) {
            throw new InvalidIntOrFloatException($this->name, $this->value);
        } elseif ($this->value >= 0) {
            throw new NumberNotNegativeException($this->name, $this->value);
        }

        return $this;
    }
312802
private function not($value) {
        switch (func_num_args()) {
            case 0 :
                return true;
            case 1 :
                return ! $value;
            case 2 :
                $varList = func_get_arg(1);
                
                if (is_array($varList)) {
                    return $this -> not($this -> maybe($value, $varList));
                }
                
                return $value == $varList;
            default :
                $varList = func_get_args();
                $value = array_shift($varList);
                
                return $this -> not($this -> maybe($value, $varList));
        }
    }