Java Number Negate negate(double[] a)

Here you can find the source of negate(double[] a)

Description

Returns a new array that contains the negated values of the given array.

License

Open Source License

Declaration

public static double[] negate(double[] a) 

Method Source Code

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

public class Main {
    /**//from   w  w  w.j a v a 2 s. c  o  m
     * Returns a new array that contains the negated values of the given array.
     */
    public static double[] negate(double[] a) {
        double[] n = new double[a.length];
        for (int i = 0; i < a.length; i++) {
            n[i] = -a[i];
        }
        return n;
    }
}

Related

  1. negate(Boolean _value)
  2. negate(Boolean bool)
  3. negate(Boolean bool)
  4. negate(boolean[] posit)
  5. negate(Comparable v)
  6. negate(double[] output, double[] a)
  7. negate(double[] values)
  8. negate(final Boolean bool)
  9. negate(int[] ar)