Java Array Add addArrays(float[] arr1, float[] arr2, float[] arr3)

Here you can find the source of addArrays(float[] arr1, float[] arr2, float[] arr3)

Description

add Arrays

License

Open Source License

Declaration

public static float[] addArrays(float[] arr1, float[] arr2, float[] arr3) 

Method Source Code

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

public class Main {
    public static float[] addArrays(float[] arr1, float[] arr2, float[] arr3) {
        int l = arr1.length;
        float[] res = new float[l];
        for (int i = 0; i < l; i++) {
            res[i] = arr1[i] + arr2[i] + arr3[i];
        }/*ww  w  .ja  v a  2s. c o  m*/
        return res;
    }

    public static float[] addArrays(float[] arr1, float[] arr2) {
        int l = arr1.length;
        float[] res = new float[l];
        for (int i = 0; i < l; i++) {
            res[i] = arr1[i] + arr2[i];
        }
        return res;
    }
}

Related

  1. addArray(Object[][] first, Object[][]... more)
  2. addArray(StringBuffer RCode, String name, T[] array, boolean useEquals, boolean isString)
  3. addArrayAll(byte[] array1, byte[] array2)
  4. addArrayElements(byte[] toArray, byte[] fromArray)
  5. addArrays(final int[] a, final int[] b)
  6. addArrays(Object[] array1, Object[] array2)
  7. addArrays(String[] a, String[] b)
  8. addArrayToArray(byte[] baseArray, int startIndex, byte[] newArray)