Negate Numbers

@return CFXD Element
@throws TemplateException
14767
private Expression negatePlusMinusOp(Data data) throws TemplateException {
	// And Operation
	Position line = data.srcCode.getPosition();
	if (data.srcCode.forwardIfCurrent('-')) {
	    // pre increment
	    if (data.srcCode.forwardIfCurrent('-')) {
		comments(data);
		Expression expr = clip(data);
		return data.factory.opUnary((Variable) expr, data.factory.DOUBLE_ONE(), Factory.OP_UNARY_PRE, Factory.OP_UNARY_MINUS, line, data.srcCode.getPosition());

		// ExprDouble res = OpDouble.toExprDouble(expr, LitDouble.toExprDouble(1D),OpDouble.MINUS);
		// return new OpVariable((Variable)expr,res,data.cfml.getPosition());

	    }
	    comments(data);
	    return data.factory.opNegateNumber(clip(data), Factory.OP_NEG_NBR_MINUS, line, data.srcCode.getPosition());

	}
	else if (data.srcCode.forwardIfCurrent('+')) {
	    if (data.srcCode.forwardIfCurrent('+')) {
		comments(data);
		Expression expr = clip(data);

		return data.factory.opUnary((Variable) expr, data.factory.DOUBLE_ONE(), Factory.OP_UNARY_PRE, Factory.OP_UNARY_PLUS, line, data.srcCode.getPosition());
	    }
	    comments(data);
	    return data.factory.toExprDouble(clip(data));// OpNegateNumber.toExprDouble(clip(),OpNegateNumber.PLUS,line);
	}
	return clip(data);
    }
529158
function (newValue) {
            if (!this._cfgOk) {
                return -1;
            }

            var cfg = this._cfg;
            var res = null;
            if (cfg !== null) {
                if (newValue !== null && newValue !== "" && newValue >= cfg.minValue && newValue <= cfg.maxValue) {
                    res = ((newValue - cfg.minValue) / Math.abs(this._cfg.maxValue - this._cfg.minValue)) * 100;
                } else {
                    res = -1;
                }
            }
            cfg = null;
            return res;
        }
351942
Rule XcomNumber() {
		return Sequence(OneOrMore(DIGIT()),
						Optional(Sequence('.', OneOrMore(DIGIT())))
		).label(XcomNumber).suppressSubnodes();
	}
1246059
public Vector3d negate(Vector3d dest) {
        dest.x = -x;
        dest.y = -y;
        dest.z = -z;
        return dest;
    }
529045
private Expression plusMinusOp(Data data) throws TemplateException {
	Expression expr = modOp(data);

	while (!data.srcCode.isLast()) {

	    // Plus Operation
	    if (data.srcCode.forwardIfCurrent('+')) expr = _plusMinusOp(data, expr, Factory.OP_DBL_PLUS);
	    // Minus Operation
	    else if (data.srcCode.forwardIfCurrent('-')) expr = _plusMinusOp(data, expr, Factory.OP_DBL_MINUS);
	    else break;
	}
	return expr;
    }
948116
static int[] negate(int[] x, int Max) {
    int[] ans = new int[Max - x.length];
    int i = 0;
    int c = 0;
    for (int j = 0; j < x.length; ++j) {
      int v = x[j];
      for (; i < v; ++i)
        ans[c++] = i;
      ++i;
    }
    while (c < ans.length)
      ans[c++] = i++;
    return ans;
  }
1080131
def xform(self, number, relation):
        

        # pylint: disable=too-many-boolean-expressions
        if (self.CONFIG.strip) or \
           (self.CONFIG.strip_exact and relation == 0) or \
           (self.CONFIG.strip_whole and relation == 0 and \
            all(x == 0 for x in number)):
            return Strip._strip_trailing_zeros(number)
        return number
436328
@Nonnull
    public Number toJavaLangNumber() {
        int flags = getFlags();
        if ((flags & F_DOUBLE) != 0)
            return doubleValue();
        else if ((flags & F_FLOAT) != 0)
            return floatValue();
        else if ((flags & (F_LONG | F_LONGLONG)) != 0)
            return longValue();
        else if ((flags & F_INT) != 0)
            return intValue();
        else if (getFractionalPart() != null)
            return doubleValue();	// .1 is a double in Java.
        else if (getExponent() != null)
            return doubleValue();
        else {
            // This is an attempt to avoid overflowing on over-long integers.
            // However, now we just overflow on over-long longs.
            // We should really use BigInteger.
            long value = longValue();
            if (value <= Integer.MAX_VALUE && value >= Integer.MIN_VALUE)
                return (int) value;
            return value;
        }
    }
823278
public Vector4d negate(Vector4d dest) {
        dest.x = -x;
        dest.y = -y;
        dest.z = -z;
        dest.w = -w;
        return dest;
    }
815063
public BigDecimal negate() {
        if (intCompact == INFLATED) {
            return new BigDecimal(intVal.negate(), INFLATED, scale, precision);
        } else {
            return valueOf(-intCompact, scale, precision);
        }
    }
1123861
public Vector2f negate(Vector2f dest) {
        dest.x = -x;
        dest.y = -y;
        return dest;
    }
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;
    }
1023971
public static BigFloat negate(BigFloat x) {
		if (x.isSpecial())
			if (x.isInfinity())
				return x == POSITIVE_INFINITY ? NEGATIVE_INFINITY : POSITIVE_INFINITY;
			else
				return NaN;
		return x.context.valueOf(x.value.negate());
	}
113551
def num_having_numId(self, numId):
        
        xpath = './w:num[@w:numId="%d"]' % numId
        try:
            return self.xpath(xpath)[0]
        except IndexError:
            raise KeyError('no <w:num> element with numId %d' % numId)
1110853
public static <T extends Number & Comparable<?>> NumberTemplate<T> numberTemplate(Class<? extends T> cl, Template template, List<?> args) {
        return new NumberTemplate<T>(cl, template, ImmutableList.copyOf(args));
    }
230123
static Number coerceToPrimitiveNumber(Number pValue,
                                          Class pClass)
            throws ELException {
        if (pClass == Byte.class || pClass == Byte.TYPE) {
            return PrimitiveObjects.getByte(pValue.byteValue());
        } else if (pClass == Short.class || pClass == Short.TYPE) {
            return PrimitiveObjects.getShort(pValue.shortValue());
        } else if (pClass == Integer.class || pClass == Integer.TYPE) {
            return PrimitiveObjects.getInteger(pValue.intValue());
        } else if (pClass == Long.class || pClass == Long.TYPE) {
            return PrimitiveObjects.getLong(pValue.longValue());
        } else if (pClass == Float.class || pClass == Float.TYPE) {
            return PrimitiveObjects.getFloat(pValue.floatValue());
        } else if (pClass == Double.class || pClass == Double.TYPE) {
            return PrimitiveObjects.getDouble(pValue.doubleValue());
        } else {
            return PrimitiveObjects.getInteger(0);
        }
    }
490219
function parseToZeroOrNumber(value, toFloat) {
                    var num = toFloat ? parseFloat(value) : parseInt(value, 10);
                    return isNaN(num) ? 0 : num;
                }