Here you can find the source of divideArrayElements(final int[] array, final int divisor)
Parameter | Description |
---|---|
array | a parameter |
divisor | a parameter |
public static double[] divideArrayElements(final int[] array, final int divisor)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww. j a v a 2 s . c om * Average an int array elements with divisor. * * @param array * @param divisor * @return */ public static double[] divideArrayElements(final int[] array, final int divisor) { final double[] averaged = new double[array.length]; for (int i = 0; i < averaged.length; i++) { averaged[i] = ((double) array[i]) / divisor; } return averaged; } }