Java Number Negate negate(double[] values)

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

Description

Return a double array with negated values

License

Apache License

Parameter

Parameter Description
values a parameter

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**// w ww.  j  ava 2 s.co  m
     * Return a double array with negated values
     * @param values
     * @return
     */
    public static double[] negate(double[] values) {
        double[] result = new double[values.length];
        for (int i = 0; i < values.length; i++) {
            result[i] = -values[i];
        }
        return result;
    }
}

Related

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