Examples of divide()


Examples of com.arcmind.jsfquickstart.model.Calculator.divide()

  @Test()
  public void testRandomException() {
    Calculator mockCalc = EasyMock.createMock(Calculator.class);
   
    EasyMock.expect(mockCalc.divide(10, 10)).andThrow(new RuntimeException("random error"));
    EasyMock.replay(mockCalc);
    calcController.setCalculator(mockCalc);
   

    calcController.setFirstNumber(10);
View Full Code Here

Examples of com.ibm.icu.math.BigDecimal.divide()

            // Handle non-integral values or the case where parseBigDecimal is set
            else {
                BigDecimal big = digitList.getBigDecimalICU(status[STATUS_POSITIVE]);
                n = big;
                if (mult != 1) {
                    n = big.divide(BigDecimal.valueOf(mult), mathContext);
                }
            }
        }

        // Assemble into CurrencyAmount if necessary
View Full Code Here

Examples of com.jme.math.Vector3f.divide()

      if( ! textureHere.equals( textureAbove )) {
        System.out.println("The points " + here.toString() + "and " + above.toString() + " are on different textures " );
        Vector3f avg = new Vector3f();
        avg = avg.add( here  );
        avg = avg.add( above );
        avg = avg.divide( 2.0f );
        BufferUtils.setInBuffer( avg, tb.getVertexBuffer(), indexMain );
        BufferUtils.setInBuffer( avg, tb.getVertexBuffer(), indexAbove );
      }
     
    }
View Full Code Here

Examples of com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries.divide()

        return ImmutableZonedDateTimeDoubleTimeSeries.ofEmpty(now.getZone());
      }
      LocalDateDoubleTimeSeries localDateTS = ts.getTimeSeries();
      //TODO remove me when KWCDC Curncy is normalised correctly
      if (localDateTS.getLatestValue() > 0.50) {
        localDateTS = localDateTS.divide(100);
      }
      return convertTimeSeries(now.getZone(), localDateTS);
    } else if (leg instanceof InflationIndexSwapLeg) {
      final InflationIndexSwapLeg indexLeg = (InflationIndexSwapLeg) leg;
      final ExternalIdBundle id = getIndexIdForInflationSwap(indexLeg);
View Full Code Here

Examples of com.sk89q.worldedit.Vector.divide()

        if ((diff.getBlockX() & 1) + (diff.getBlockY() & 1) + (diff.getBlockZ() & 1) != 0) {
            throw new RegionOperationException(
                    "Ellipsoid changes must be even for each dimensions.");
        }

        return diff.divide(2).floor();
    }

    private Vector calculateChanges(Vector... changes) {
        Vector total = new Vector();
        for (Vector change : changes) {
View Full Code Here

Examples of com.sk89q.worldedit.Vector2D.divide()

        if ((diff.getBlockX() & 1) + (diff.getBlockZ() & 1) != 0) {
            throw new RegionOperationException("Cylinders changes must be even for each horizontal dimensions.");
        }

        return diff.divide(2).floor();
    }

    private Vector2D calculateChanges2D(Vector... changes) {
        Vector2D total = new Vector2D();
        for (Vector change : changes) {
View Full Code Here

Examples of de.abg.jreichert.junit4runner.Divider.divide()

public class DividerTest extends TestCase {

  public void testDivide() {
    Divider divider = new Divider();
    BigDecimal quotient = divider.divide(new BigDecimal(45), new BigDecimal(9));
    Assert.assertEquals("expected quotient", new BigDecimal(5), quotient);
  }
}
View Full Code Here

Examples of de.jungblut.math.DoubleMatrix.divide()

      final int m, NetworkConfiguration conf) {
    // calculate the gradients of the weights
    for (int i = 0; i < thetaGradients.length; i++) {
      DoubleMatrix gradDXA = multiply(deltaX[i + 1], ax[i], true, false, conf);
      if (m != 1) {
        thetaGradients[i] = gradDXA.divide(m);
      } else {
        thetaGradients[i] = gradDXA;
      }
      if (conf.lambda != 0d) {
        thetaGradients[i] = thetaGradients[i].add((thetas[i]
View Full Code Here

Examples of de.jungblut.math.DoubleVector.divide()

      // return null so minimizers should fast-fail
      return null;
    }
    // just return an average over the batches
    return new CostGradientTuple(costSum / submittedBatches,
        gradientSum.divide(submittedBatches));
  }

  /**
   * Evaluate the batch.
   *
 
View Full Code Here

Examples of de.jungblut.math.dense.DenseDoubleVector.divide()

      // return null so minimizers should fast-fail
      return null;
    }
    // just return an average over the batches
    return new CostGradientTuple(costSum / submittedBatches,
        gradientSum.divide(submittedBatches));
  }

  /**
   * Evaluate the batch.
   *
 
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.