Examples of DoubleValue


Examples of client.net.sf.saxon.ce.value.DoubleValue

            BuiltInAtomicType itemType = soughtValue.getPrimitiveType();
            if (itemType.equals(BuiltInAtomicType.INTEGER) ||
                    itemType.equals(BuiltInAtomicType.DECIMAL) ||
                    itemType.equals(BuiltInAtomicType.FLOAT)) {
                soughtValue = new DoubleValue(((NumericValue)soughtValue).getDoubleValue());
            }
        }

        // NOTE: This is much more elaborate than it needs to be. The option convertUntypedToOther
        // is used for an index used to support a general comparison. This reports an error if two
View Full Code Here

Examples of client.net.sf.saxon.ce.value.DoubleValue

        // If either operand is a number, convert both operands to xs:double using
        // the rules of the number() function, and compare them

        if (t0.isPrimitiveNumeric() || t1.isPrimitiveNumeric()) {
            DoubleValue v0 = NumberFn.convert(a0);
            DoubleValue v1 = NumberFn.convert(a1);
            return ValueComparison.compare(v0, operator, v1, comparer, false);
        }

        // If either operand is a string, or if both are untyped atomic, convert
        // both operands to strings and compare them
View Full Code Here

Examples of com.caucho.quercus.env.DoubleValue

   *
   * @return the expression value.
   */
  public Value eval(Env env)
  {
    return new DoubleValue(_expr.evalDouble(env));
  }
View Full Code Here

Examples of com.neuralnetwork.shared.values.DoubleValue

        final INeuralNetContext nnctx) {
        double sum = 0.0;
        for (ILink il : getInputs()) {
            sum += il.getWeight().getValue() * v.getValue();
        }
        DoubleValue n = new DoubleValue(getActivationFunction().activate(sum));
        setValue(n);
    return new ErrorValue(n.getValue());
    }
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue

     * Sequence argument
     * @throws Exception if an error occurs
     */
    public void testNumberWithEmptySequence() throws Exception {
        // invoke the method
        DoubleValue result = PipelineExpressionHelper.fnNumber(Sequence.EMPTY,
                                                       factory);
        // check the result
        assertTrue("unexpected number result",
                   Double.isNaN(result.asJavaDouble()));

    }
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue

     * of one "NaN" StringValue Item
     * @throws Exception if an error occurs
     */
    public void testNumberWithNaNStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("NaN").getSequence();
        DoubleValue result = PipelineExpressionHelper.fnNumber(seq, factory);
        assertTrue("number('NaN') should return NaN DoubleValue",
                   Double.isNaN(result.asJavaDouble()));
    }
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue

     * of one invalid double StringValue Item
     * @throws Exception if an error occurs
     */
    public void testNumberWithinValidDoubleStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("fred").getSequence();
        DoubleValue result = PipelineExpressionHelper.fnNumber(seq, factory);
        assertTrue("number('fred') should return NaN DoubleValue",
                   Double.isNaN(result.asJavaDouble()));
    }
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue

     * @throws Exception if an error occurs
     */
    public void doTestNumber(Sequence sequence, double expected)
            throws Exception {
        // invoke the method
        DoubleValue result = PipelineExpressionHelper.fnNumber(sequence, factory);
        // check the result
        assertEquals("unexpected number result",
                     expected,
                     result.asJavaDouble(),
                     0.1);

    }
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue

        // obtain length of sequence
        int length = sequence.getLength();

        // value of operand cast to a double
        DoubleValue eval = DoubleValue.NOT_A_NUMBER;

        // if length is zero then we return NaN
        if (length == 1) {
            // if length is 1 (ie atomic value) then the following rules apply
            Value sv = sequence.getItem(1);
View Full Code Here

Examples of com.volantis.xml.expression.atomic.numeric.DoubleValue

     * @param value The value to get as an integer.
     * @return The value as an int.
     */
    private int getIntRound(Value value) {
        if (value instanceof DoubleValue) {
            DoubleValue doubleValue = (DoubleValue) value;
            return (int) Math.round(doubleValue.asJavaDouble());
        } else if (value instanceof IntValue) {
            IntValue intValue = (IntValue) value;
            return intValue.asJavaInt();
        } else {
            throw new IllegalArgumentException(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.