Java Number Power pow(double[] array, double exp)

Here you can find the source of pow(double[] array, double exp)

Description

calls Math.pow for each element of the array

License

Open Source License

Parameter

Parameter Description
array a parameter
exp the exponent.

Return

reference to the input array

Declaration

public static double[] pow(double[] array, double exp) 

Method Source Code

//package com.java2s;
/*//  w  ww .  j a  v a2 s  . co m
 * Copyright (C) 2010-2014  Andreas Maier
 * CONRAD is developed as an Open Source project under the GNU General Public License (GPL).
*/

public class Main {
    /**
     * calls Math.pow for each element of the array
     * @param array
     * @param exp the exponent.
     * @return reference to the input array
     */
    public static double[] pow(double[] array, double exp) {
        for (int i = 0; i < array.length; i++) {
            array[i] = Math.pow(array[i], exp);
        }
        return array;
    }
}

Related

  1. pow(double value)
  2. pow(double x, double y)
  3. pow(double x, double y)
  4. pow(double x, double y)
  5. pow(double x, int n)
  6. pow(double[][] x, int p)
  7. pow(final double[] values, final double exp)
  8. pow(final float a, final float b)
  9. pow(final int a, final int b)