Examples of div()


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

        MathTool mathTool = (MathTool)toolbox.get("math");
        assertNotNull(mathTool);
        assertEquals(1,mathTool.abs(-1));
        assertEquals(2,mathTool.add(1,1));
        assertEquals(3,mathTool.ceil(2.5));
        assertEquals(4,mathTool.div(8,2));
        assertEquals(5,mathTool.floor(5.1));
        assertEquals(6,mathTool.getAverage(new long[] {5,6,7}));
        /* getTotal() watches the type of its first argument, so assertEquals needs a long */
        assertEquals((long)7,mathTool.getTotal(new long[] {2,2,3}));
        assertEquals(8,mathTool.idiv(130,16));
View Full Code Here

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

        MathTool mathTool = (MathTool)toolbox.get("math");
        assertNotNull(mathTool);
        assertEquals(1,mathTool.abs(-1));
        assertEquals(2,mathTool.add(1,1));
        assertEquals(3,mathTool.ceil(2.5));
        assertEquals(4,mathTool.div(8,2));
        assertEquals(5,mathTool.floor(5.1));
        assertEquals(6,mathTool.getAverage(new long[] {5,6,7}));
        /* getTotal() watches the type of its first argument, so assertEquals needs a long */
        assertEquals((long)7,mathTool.getTotal(new long[] {2,2,3}));
        assertEquals(8,mathTool.idiv(130,16));
View Full Code Here

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

        MathTool mathTool = (MathTool)toolbox.get("math");
        assertNotNull(mathTool);
        assertEquals(1,mathTool.abs(-1));
        assertEquals(2,mathTool.add(1,1));
        assertEquals(3,mathTool.ceil(2.5));
        assertEquals(4,mathTool.div(8,2));
        assertEquals(5,mathTool.floor(5.1));
        assertEquals(6,mathTool.getAverage(new long[] {5,6,7}));
        /* getTotal() watches the type of its first argument, so assertEquals needs a long */
        assertEquals((long)7,mathTool.getTotal(new long[] {2,2,3}));
        assertEquals(8,mathTool.idiv(130,16));
View Full Code Here

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

        MathTool mathTool = (MathTool)toolbox.get("math");
        assertNotNull(mathTool);
        assertEquals(1,mathTool.abs(-1));
        assertEquals(2,mathTool.add(1,1));
        assertEquals(3,mathTool.ceil(2.5));
        assertEquals(4,mathTool.div(8,2));
        assertEquals(5,mathTool.floor(5.1));
        assertEquals(6,mathTool.getAverage(new long[] {5,6,7}));
        /* getTotal() watches the type of its first argument, so assertEquals needs a long */
        assertEquals((long)7,mathTool.getTotal(new long[] {2,2,3}));
        assertEquals(8,mathTool.idiv(130,16));
View Full Code Here

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

        MathTool mathTool = (MathTool)toolbox.get("math");
        assertNotNull(mathTool);
        assertEquals(1,mathTool.abs(-1));
        assertEquals(2,mathTool.add(1,1));
        assertEquals(3,mathTool.ceil(2.5));
        assertEquals(4,mathTool.div(8,2));
        assertEquals(5,mathTool.floor(5.1));
        assertEquals(6,mathTool.getAverage(new long[] {5,6,7}));
        /* getTotal() watches the type of its first argument, so assertEquals needs a long */
        assertEquals((long)7,mathTool.getTotal(new long[] {2,2,3}));
        assertEquals(8,mathTool.idiv(130,16));
View Full Code Here

Examples of org.archfirst.common.money.Money.div()

            totalPrice = totalPrice.plus(
                    execution.getPrice().times(execution.getQuantity()));
            totalQuantity = totalQuantity.plus(execution.getQuantity());
        }
        totalPrice = totalPrice.scaleToCurrency();
        return totalPrice.div(totalQuantity, Constants.PRICE_SCALE);
    }
   
    @Transient
    private Money getFees() {
        return FIXED_FEE;
View Full Code Here

Examples of org.archfirst.common.money.Money.div()

            totalPrice = totalPrice.plus(
                    execution.getPrice().times(execution.getQuantity()));
            totalQuantity = totalQuantity.plus(execution.getQuantity());
        }
        totalPrice = totalPrice.scaleToCurrency();
        return totalPrice.div(totalQuantity, Constants.PRICE_SCALE);
    }
   
    /** Returns true if this order is filled */
    @Transient
    public boolean isFilled() {
View Full Code Here

Examples of org.bouncycastle.pqc.math.ntru.polynomial.BigIntPolynomial.div()

            t.add(g.mult(gRev));
            Resultant rt = t.resultant();
            C = fRev.mult(B);   // fRev.mult(B) is actually faster than new SparseTernaryPolynomial(fRev).mult(B), possibly due to cache locality?
            C.add(gRev.mult(A));
            C = C.mult(rt.rho);
            C.div(rt.res);
        }
        else
        {   // KeyGenAlg.FLOAT
            // calculate ceil(log10(N))
            int log10N = 0;
View Full Code Here

Examples of org.bouncycastle.pqc.math.ntru.polynomial.IntegerPolynomial.div()

        {
            Polynomial f = kPriv.getBasis(iLoop).f;
            Polynomial fPrime = kPriv.getBasis(iLoop).fPrime;

            IntegerPolynomial y = f.mult(i);
            y.div(q);
            y = fPrime.mult(y);

            IntegerPolynomial x = fPrime.mult(i);
            x.div(q);
            x = f.mult(x);
View Full Code Here

Examples of org.bouncycastle.pqc.math.ntru.polynomial.IntegerPolynomial.div()

            IntegerPolynomial y = f.mult(i);
            y.div(q);
            y = fPrime.mult(y);

            IntegerPolynomial x = fPrime.mult(i);
            x.div(q);
            x = f.mult(x);

            IntegerPolynomial si = y;
            si.sub(x);
            s.add(si);
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.