Here you can find the source of div(float[] nums, int n)
public static float[] div(float[] nums, int n)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { public static float[] div(float[] nums, int n) { for (int i = 0; i < nums.length; i++) nums[i] /= n;/*from www. j a va 2s .c o m*/ return nums; } public static float[] div(float[] nums, float n) { assert !Float.isInfinite(n) : "Trying to divide " + Arrays.toString(nums) + " by " + n; // Almost surely not what you want for (int i = 0; i < nums.length; i++) nums[i] /= n; return nums; } public static double[] div(double[] nums, double n) { assert !Double.isInfinite(n) : "Trying to divide " + Arrays.toString(nums) + " by " + n; // Almost surely not what you want for (int i = 0; i < nums.length; i++) nums[i] /= n; return nums; } public static double[][] div(double[][] ds, long[] n) { for (int i = 0; i < ds.length; i++) div(ds[i], n[i]); return ds; } public static double[] div(double[] ds, long[] n) { for (int i = 0; i < ds.length; i++) ds[i] /= n[i]; return ds; } public static String[] toString(long[] dom) { String[] result = new String[dom.length]; for (int i = 0; i < dom.length; i++) result[i] = String.valueOf(dom[i]); return result; } public static String[] toString(int[] dom) { String[] result = new String[dom.length]; for (int i = 0; i < dom.length; i++) result[i] = String.valueOf(dom[i]); return result; } public static String[] toString(Object[] ary) { String[] result = new String[ary.length]; for (int i = 0; i < ary.length; i++) { Object o = ary[i]; if (o != null && o.getClass().isArray()) { Class klazz = ary[i].getClass(); result[i] = byte[].class.equals(klazz) ? Arrays .toString((byte[]) o) : short[].class.equals(klazz) ? Arrays .toString((short[]) o) : int[].class.equals(klazz) ? Arrays .toString((int[]) o) : long[].class.equals(klazz) ? Arrays .toString((long[]) o) : boolean[].class .equals(klazz) ? Arrays .toString((boolean[]) o) : float[].class .equals(klazz) ? Arrays .toString((float[]) o) : double[].class .equals(klazz) ? Arrays .toString((double[]) o) : Arrays.toString((Object[]) o); } else { result[i] = String.valueOf(o); } } return result; } }