Examples of abs()


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

    }

    public @Test void testMathTool() {
        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}));
View Full Code Here

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

    }

    public @Test void testMathTool() {
        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}));
View Full Code Here

Examples of org.exist.xquery.value.NumericValue.abs()

          if (item instanceof NumericValue) {
        value = (NumericValue) item;
      } else {
        value = (NumericValue) item.convertTo(Type.NUMBER);
      }
            result = value.abs();
        }
        if (context.getProfiler().isEnabled())
            {context.getProfiler().end(this, "", result);}
        return result;
    }
View Full Code Here

Examples of org.mifosplatform.organisation.monetary.domain.Money.abs()

        final Money totalPrincipalRemaining = this.principal.minus(totalCumulativePrincipalToDate);
        if (totalPrincipalRemaining.isLessThanZero()) {
            // paid too much principal, subtract amount that overpays from
            // principal paid for period.
            adjusted = principalForPeriod.minus(totalPrincipalRemaining.abs());
        } else if (multiDisburseLoan) {
            final Money difference = this.principal.minus(totalCumulativePrincipalToDate);
            final Money halfPrincipalVal = principalForPeriod.dividedBy(2, RoundingMode.HALF_DOWN);
            if (difference.isLessThan(halfPrincipalVal)) {
                adjusted = principalForPeriod.plus(difference.abs());
View Full Code Here

Examples of org.spout.math.vector.Vector3f.abs()

      }
      // Add +1 to change direction
      if (cause instanceof EntityCause) {
        // set data using direction
        Vector3f direction = block.getPosition().sub((((EntityCause) cause).getSource()).getPhysics().getPosition());
        direction = direction.abs();
        if (direction.getX() > direction.getZ()) {
          data++;
        }
      } else {
        data += (int) Math.round(Math.random());
View Full Code Here

Examples of wyautl.util.BigRational.abs()

      BigRational val = coefficient.value;
      if(gcd == null) {
        // Must use abs() here, otherwise can end up with negative gcd.
        // This is problematic for inequalities as it necessitate
        // changing their sign.
        gcd = val.abs();
      } else {
        // Note, gcd of two numbers (either of which may be negative) is
        // always positive.
        gcd = gcd.gcd(val);
      }
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.