List of utility methods to do Integer Create
int | toInt(double d) Simple method to convert a Double object to a primitive int return (int) d; |
int | toInt(double f) Convert a double into an int return (f - (double) ((int) f) < 0.5) ? (int) f : (int) f + 1; |
int | toInt(double in) to Int return (int) Math.round(in); |
long | toInt(double num) Convert a double number into a integer return (new Double(num)).intValue(); |
int | toInt(double val) to Int return (int) Math.floor(val + DOUBLE_EPS); |
int | toInt(double value) to Int return (int) value; |
int[] | toInt(double[] arr) for each i result[i]=(int)array[i] int len = arr.length; int[] res = new int[len]; for (int i = 0; i < len; i++) { res[i] = (int) arr[i]; return res; |
int[] | toInt(double[] array) 1-D Double array to integer array. int[] n = new int[array.length]; for (int i = 0; i < array.length; i++) { n[i] = (int) array[i]; return n; |
int | toInt(double[] layer) to Int return toInt(layer, 0, layer.length);
|
int[] | toInt(double[] v) to Int final int[] ans = new int[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (int) v[k]; return (ans); |