Examples of divide()


Examples of JSci.maths.Complex.divide()

            cpxDenom = cpxDenom.add( cpxZpwr.multiply(b) );
           
            cpxZpwr  = cpxZpwr.divide(z);
        }
       
        return cpxNumer.divide(cpxDenom);
    }

    /**
     * Clears the input and output buffers, resetting filter for
     * a new signal.
View Full Code Here

Examples of ai.domain.interval.IntervalExpressionSemantics.divide()

  public void testDivide(){
    IntervalExpressionSemantics sem = new IntervalExpressionSemantics();
    //bottom
    for(Interval val: Arrays.asList(Interval.BOTTOM, new Interval(1,2), new Interval(1,Double.POSITIVE_INFINITY),
        new Interval(Double.NEGATIVE_INFINITY, 3), TOP)){
      org.junit.Assert.assertEquals(Interval.BOTTOM, sem.divide(val, Interval.BOTTOM));
      org.junit.Assert.assertEquals(Interval.BOTTOM, sem.divide(Interval.BOTTOM, val));
    }
    //others
    org.junit.Assert.assertEquals(Interval.BOTTOM, sem.divide(new Interval(1,1), new Interval(0,0)));
    org.junit.Assert.assertEquals(new Interval(1, Double.POSITIVE_INFINITY), sem.divide(new Interval(1,1), new Interval(0,1)));
View Full Code Here

Examples of ariba.util.core.ArithmeticOperations.divide()

            case NONNUMERIC :
                // if this is modified, please modify the getArithmeticOperations
                // in TypeChecker as well
                ops = getArithmeticOperations(v1Type);
                if (ops != null) {
                    return ops.divide(v1, v2);
                }
                return newReal(type, doubleValue(v1) / doubleValue(v2));
            case CUSTOMNUMERICTYPE:
                // support money/BigDecimal and
                // money/money as in getting percentage
View Full Code Here

Examples of ca.eandb.jmist.framework.color.Color.divide()

          Complex    eta2  = new Complex(n2avg, k2avg);
          Vector3    out    = Optics.refract(v, eta1, eta2, normal);
          boolean    toSide  = x.getNormal().dot(out) >= 0.0;

          if (fromSide != toSide) {
            return ScatteredRay.transmitSpecular(new Ray3(p, out), T.divide(1 - r), 1 - r);
          }
//        }
      }

    }
View Full Code Here

Examples of ca.eandb.jmist.math.Vector3.divide()

  public void illuminate(SurfacePoint x, WavelengthPacket lambda, Random rng, Illuminable target) {

    Vector3    lightIn      = x.getPosition().vectorTo(this.position);
    double    dSquared    = lightIn.squaredLength();

    lightIn = lightIn.divide(Math.sqrt(dSquared));

    double    ndotl      = x.getShadingNormal().dot(lightIn);
    double    attenuation    = Math.abs(ndotl) / (4.0 * Math.PI * dSquared);

    target.addLightSample(new PointLightSample(x, position, emittedPower.sample(lambda).times(attenuation), shadows));
View Full Code Here

Examples of calculator.CalculatorService.divide()

           
            // Calculate
            System.out.println("3 + 2=" + calculatorService.add(3, 2));
            System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
            System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
            System.out.println("3 / 2=" + calculatorService.divide(3, 2));
           
            if (args.length > 1){
                for (int i=0; i < 1000; i++){
                    // Calculate
                    System.out.println("3 + 2=" + calculatorService.add(3, 2));
View Full Code Here

Examples of calculator.dosgi.CalculatorService.divide()

            Assert.assertNotNull(service);
            CalculatorService calculator = OSGiTestBundles.cast(service, CalculatorService.class);
            System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0));
            System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0));
            System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0));
            System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0));
        }
    }

    /**
     * @throws java.lang.Exception
View Full Code Here

Examples of cc.redberry.core.number.Complex.divide()

        List<Tensor> newTos = new ArrayList<>();
        while (true) {
            if (subsResult == null)
                break;
            factor = factor.divide(fromFactor);
            newTos.add(subsResult.newTo);
            content = subsResult.remainder;
            subsResult = atomicSubstitute(content, forbidden, iterator);
        }
        Tensor[] result = new Tensor[newTos.size() + content.indexless.length + 2];
View Full Code Here

Examples of cc.redberry.core.tensor.TensorNumber.divide()

            return tensor;
        Fraction fraction = (Fraction) tensor;
        if (fraction.getNumerator() instanceof TensorNumber
                && fraction.getDenominator() instanceof TensorNumber) {
            TensorNumber num = (TensorNumber) fraction.getNumerator();
            num.divide((TensorNumber) fraction.getDenominator());
            tensor = null;
            return num;
        }
        return tensor;
    }
View Full Code Here

Examples of com.CompPad.model.ComplexAmount.divide()

                            }
                            else{
                                // otherwise, we're good.
                                // divide out by our x and y units
                                newRow[0] = a1.divide(xEvalUnit.getValue()).getReal(Unit.ONE);
                                newRow[j+1] = a2.divide(yEvalUnit.getValue()).getReal(Unit.ONE);
                                x.add(newRow);
                                mm++;
                            }

                        }
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.