Examples of round()


Examples of net.sf.saxon.value.NumericValue.round()

        int start = (int)startVal.round().longValue();

        if (argument.length==3) {
            AtomicValue lengthVal0 = (AtomicValue)argument[2].evaluateItem(context);
            NumericValue lengthVal = (NumericValue)lengthVal0.getPrimitiveValue();
            int end = start + (int)lengthVal.round().longValue() - 1;
            if (start < 1) {
                start = 1;
            }
            return PositionIterator.make(seq, start, end);
        } else {
View Full Code Here

Examples of net.sf.saxon.value.NumericValue.round()

            case FLOOR:
                return val.floor();
            case CEILING:
                return val.ceiling();
            case ROUND:
                return val.round();
            case HALF_EVEN:
                int scale = 0;
                if (argument.length==2) {
                    AtomicValue scaleVal0 = (AtomicValue)argument[1].evaluateItem(context);
                    NumericValue scaleVal = (NumericValue)scaleVal0;
View Full Code Here

Examples of net.sf.saxon.value.NumericValue.round()

        if (e != this) {
            return e;
        }
        if (getNumberOfArguments() == 2 && Literal.isAtomic(argument[1])) {
            NumericValue start = (NumericValue)((Literal)argument[1]).getValue();
            start = start.round();
            long intstart = start.longValue();
            if (intstart > Integer.MAX_VALUE) {
                return new Literal(EmptySequence.getInstance());
            }
            return new TailExpression(argument[0], (int)intstart);
View Full Code Here

Examples of net.sf.saxon.value.NumericValue.round()

                lstart = startVal.longValue();
                if (lstart <= 1) {
                    return seq;
                }
            } else {
                startVal = startVal.round();
                if (startVal.compareTo(Int64Value.PLUS_ONE) <= 0) {
                    return seq;
                } else if (startVal.compareTo(Int64Value.MAX_LONG) > 0) {
                    return EmptyIterator.getInstance();
                } else if (startVal.isNaN()) {
View Full Code Here

Examples of net.sf.saxon.value.NumericValue.round()

                startVal = startVal.round();

                if (lengthVal.isNaN()) {
                    return EmptyIterator.getInstance();
                }
                lengthVal = lengthVal.round();

                if (lengthVal.compareTo(Int64Value.ZERO) <= 0) {
                    return EmptyIterator.getInstance();
                }
                NumericValue rend = (NumericValue)ArithmeticExpression.compute(
View Full Code Here

Examples of org.apache.velocity.tools.generic.MathTool.round()

        assertEquals(8,mathTool.idiv(130,16));
        assertEquals(9,mathTool.max(9,-10));
        assertEquals(10,mathTool.min(10,20));
        assertEquals(11,mathTool.mod(37,13));
        assertEquals(12,mathTool.mul(3,4));
        assertEquals(13,mathTool.round(12.8));
        assertEquals(14.2,mathTool.roundTo(1,14.18));
        assertEquals(-5.0,mathTool.roundTo(2,-4.999));
        assertEquals(15,mathTool.sub(30,15));
        assertEquals(16,mathTool.pow(4,2));
        assertEquals(17,mathTool.toInteger("17"));
View Full Code Here

Examples of org.apache.velocity.tools.generic.MathTool.round()

        assertEquals(8,mathTool.idiv(130,16));
        assertEquals(9,mathTool.max(9,-10));
        assertEquals(10,mathTool.min(10,20));
        assertEquals(11,mathTool.mod(37,13));
        assertEquals(12,mathTool.mul(3,4));
        assertEquals(13,mathTool.round(12.8));
        assertEquals(14.2,mathTool.roundTo(1,14.18));
        assertEquals(-5.0,mathTool.roundTo(2,-4.999));
        assertEquals(15,mathTool.sub(30,15));
        assertEquals(16,mathTool.pow(4,2));
        assertEquals(17,mathTool.toInteger("17"));
View Full Code Here

Examples of org.apache.velocity.tools.generic.MathTool.round()

        assertEquals(8,mathTool.idiv(130,16));
        assertEquals(9,mathTool.max(9,-10));
        assertEquals(10,mathTool.min(10,20));
        assertEquals(11,mathTool.mod(37,13));
        assertEquals(12,mathTool.mul(3,4));
        assertEquals(13,mathTool.round(12.8));
        assertEquals(14.2,mathTool.roundTo(1,14.18));
        assertEquals(15,mathTool.sub(30,15));
        assertEquals(16,mathTool.pow(4,2));
        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
View Full Code Here

Examples of org.apache.velocity.tools.generic.MathTool.round()

        assertEquals(8,mathTool.idiv(130,16));
        assertEquals(9,mathTool.max(9,-10));
        assertEquals(10,mathTool.min(10,20));
        assertEquals(11,mathTool.mod(37,13));
        assertEquals(12,mathTool.mul(3,4));
        assertEquals(13,mathTool.round(12.8));
        assertEquals(14.2,mathTool.roundTo(1,14.18));
        assertEquals(-5.0,mathTool.roundTo(2,-4.999));
        assertEquals(15,mathTool.sub(30,15));
        assertEquals(16,mathTool.pow(4,2));
        assertEquals(17,mathTool.toInteger("17"));
View Full Code Here

Examples of org.bouncycastle.pqc.math.ntru.polynomial.BigDecimalPolynomial.round()

            BigDecimalPolynomial gInv = rg.rho.div(new BigDecimal(rg.res), A.getMaxCoeffLength() + 1 + log10N);

            BigDecimalPolynomial Cdec = fInv.mult(B);
            Cdec.add(gInv.mult(A));
            Cdec.halve();
            C = Cdec.round();
        }

        BigIntPolynomial F = (BigIntPolynomial)B.clone();
        F.sub(f.mult(C));
        BigIntPolynomial G = (BigIntPolynomial)A.clone();
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.