Here you can find the source of toInts(double[] arr)
Parameter | Description |
---|---|
arr | the array to be converted |
public static int[] toInts(double[] arr)
//package com.java2s; public class Main { /**// ww w . ja v a 2 s .c o m * This converts an array of doubles to integers (using type-casts, not rounding). * @param arr the array to be converted * @return an integer version of the given array */ public static int[] toInts(double[] arr) { int[] ret = new int[arr.length]; for (int i = 0; i < arr.length; i++) { ret[i] = (int) arr[i]; } return ret; } }