Java Array Divide divide(double[] t1, double[] t2)

Here you can find the source of divide(double[] t1, double[] t2)

Description

divide

License

Open Source License

Declaration

static public double[] divide(double[] t1, double[] t2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    static public double[] divide(double[] t1, double[] t2) {

        if (t1.length != t2.length && t1 != null && t2 != null) {
            System.err.println("incorrect array multiplication");
            return null;
        } else {/*from   w  w  w .  jav a  2 s  . com*/
            double[] res = new double[t2.length];
            for (int i = 0; i < t1.length; i++) {
                if (t2[i] != 0)
                    res[i] = t1[i] / t2[i];
                else
                    res[i] = 9999999;
            }
            return res;
        }

    }
}

Related

  1. divide(double[] a, double[] b)
  2. divide(double[] array, double divisor)
  3. divide(double[] array, double value)
  4. divide(double[] dividend, double[] divisor, double dividendAdjustment, double divisorAdjustment)
  5. divide(double[] numerator, double[] denominator)
  6. divide(double[][] arr1, double[][] arr2)
  7. divide(double[][] numerator, double[][] denominator)
  8. divide(final double[] numerators, final double[] denominators)
  9. divide(final double[] v1, final double[] v2)