Here you can find the source of pow(int[] arr, double p)
Parameter | Description |
---|---|
arr | the array to be POW |
p | a parameter |
public static void pow(int[] arr, double p)
//package com.java2s; //License from project: Open Source License public class Main { public static void pow(int[] arr, double p) { for (int i = 0, l = arr.length; i < l; i++) { arr[i] = (int) Math.pow(arr[i], p); }//ww w .j a v a 2 s .c om } public static void pow(double[] arr, double p) { for (int i = 0, l = arr.length; i < l; i++) { arr[i] = (double) Math.pow(arr[i], p); } } public static void pow(float[] arr, double p) { for (int i = 0, l = arr.length; i < l; i++) { arr[i] = (float) Math.pow(arr[i], p); } } public static void pow(long[] arr, double p) { for (int i = 0, l = arr.length; i < l; i++) { arr[i] = (long) Math.pow(arr[i], p); } } public static void pow(short[] arr, double p) { for (int i = 0, l = arr.length; i < l; i++) { arr[i] = (short) Math.pow(arr[i], p); } } public static void pow(byte[] arr, double p) { for (int i = 0, l = arr.length; i < l; i++) { arr[i] = (byte) Math.pow(arr[i], p); } } }