cdm/src/main/java/ucar/ma2/MAMath.java
public static void addDouble(Array result, Array a, Array b)
      throws IllegalArgumentException {

    if (!conformable(result, a) || !conformable(a, b))
      throw new IllegalArgumentException();

    IndexIterator iterR = result.getIndexIterator();
    IndexIterator iterA = a.getIndexIterator();
    IndexIterator iterB = b.getIndexIterator();

    while (iterA.hasNext())
      iterR.setDoubleNext(iterA.getDoubleNext() + iterB.getDoubleNext());
  }
public static void addDouble(Array result, Array a, Array b)
      throws IllegalArgumentException {

    if (!conformable(result, a) || !conformable(a, b))
      throw new IllegalArgumentException();

    IndexIterator iterR = result.getIndexIterator();
    IndexIterator iterA = a.getIndexIterator();
    IndexIterator iterB = b.getIndexIterator();

    while (iterA.hasNext())
      iterR.setDoubleNext(iterA.getDoubleNext() + iterB.getDoubleNext());
  }
public static void addDouble ( Array result , Array a , Array b ) throws IllegalArgumentException { if ( ! conformable ( result , a ) || ! conformable ( a , b ) ) throw new IllegalArgumentException ( ) ; IndexIterator iterR = result . getIndexIterator ( ) ; IndexIterator iterA = a . getIndexIterator ( ) ; IndexIterator iterB = b . getIndexIterator ( ) ; while ( iterA . hasNext ( ) ) iterR . setDoubleNext ( iterA . getDoubleNext ( ) + iterB . getDoubleNext ( ) ) ; }
Add elements of two arrays together as doubles, place sum in the result array.
The values from the arrays a and b are converted to double (if needed),
and the sum is converted to the type of result (if needed).

@param result result array
@param a operand
@param b operand
@throws IllegalArgumentException a,b,and result are not conformable
Add elements of two arrays together as doubles place sum in the result array . The values from the arrays a and b are converted to double ( if needed ) and the sum is converted to the type of result ( if needed ) .