Examples of round()


Examples of java.math.BigDecimal.round()

      x = x.movePointLeft( scale );
    }

    if ( prec < nInit ) // for prec 15 root x0 must surely be OK
    {
      return x.round( rootMC );        // return small prec roots without iterations
    }
    // Initial v - the reciprocal
    BigDecimal v = BigDecimal.ONE.divide( TWO.multiply( x ), nMC );        // v0 = 1/(2*x)

    // Collect iteration precisions beforehand
View Full Code Here

Examples of nav.util.math.NumUtil.Round()

                switch (quad) {
                    case N:
                        this.deg = deg;
                        this.minsDecMins = minsDecMins;
                        this.coordinate = coOrdinate;
                        decCoordinate = nu.Round(this.deg + (float) this.minsDecMins / 60, Coordinate.MINPRECISION);
                        break;

                    case S:
                        this.deg = -deg;
                        this.minsDecMins = minsDecMins;
View Full Code Here

Examples of net.algart.math.patterns.Pattern.round()

            System.out.println("Minimal coordinates: " + p.coordMin());
            System.out.println("Maximal coordinates: " + p.coordMax());
            for (int k = 0; k < p.dimCount(); k++) {
                System.out.println("Range of coordinate #" + k + ": " + p.coordRange(k));
            }
            points = p.round().lowerSurface(iterationIndex % dimCount).points();
            System.out.println(points.size() + " left points along axis #" + iterationIndex % dimCount + ":");
            if (points.size() < 1000)
                System.out.println(new TreeSet<Point>(points));
            points = p.round().upperSurface(iterationIndex % dimCount).points();
            System.out.println(points.size() + " right points along axis #" + iterationIndex % dimCount + ":");
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 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.getPrimitiveValue();
View Full Code Here

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

                    if (val instanceof NumericValue) {
                        num = (NumericValue) val;
                    } else {
                        num = NumberFn.convert(val);
                    }
                    num = num.round();
                    if (num.compareTo(IntegerValue.MAX_LONG) > 0) {
                        DynamicError e = new DynamicError("A number is too large to be formatted");
                        e.setXPathContext(context);
                        e.setErrorCode("SAXON:0000");
                        throw e;
View Full Code Here

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

    public SequenceIterator iterate(XPathContext context) throws XPathException {
        SequenceIterator seq = argument[0].iterate(context);
        AtomicValue startVal0 = (AtomicValue)argument[1].evaluateItem(context);
        NumericValue startVal = (NumericValue)startVal0.getPrimitiveValue();
        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;
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.