Java Abs abs(double[] da)

Here you can find the source of abs(double[] da)

Description

abs

License

Open Source License

Parameter

Parameter Description
da - the input double array.

Return

the absolute value for an array of doubles

Declaration


public static double[] abs(double[] da) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from   w  ww  . j a  v a 2  s. com*/
     * @param da - the input double array.
     * @return the absolute value for an array of doubles
     */

    public static double[] abs(double[] da) {
        double[] out = da.clone();
        for (int i = 0; i < out.length; i++) {
            out[i] = Math.abs(out[i]);
        }
        return out;
    }
}

Related

  1. abs(double x)
  2. abs(double z)
  3. abs(double... values)
  4. abs(double[] arr)
  5. abs(double[] array)
  6. abs(double[] in)
  7. abs(double[] in)
  8. abs(double[] v)
  9. abs(double[][] A)