Here you can find the source of toIntRound(double[] a)
public static final int[] toIntRound(double[] a)
//package com.java2s; //License from project: Apache License public class Main { public static final int[] toIntRound(double[] a) { int[] b = new int[a.length]; for (int i = 0; i < a.length; i++) { b[i] = (int) Math.round(a[i]); }//from w w w. j a v a2 s. c om return b; } public static final int[] toIntRound(float[] a) { int[] b = new int[a.length]; for (int i = 0; i < a.length; i++) { b[i] = (int) Math.round(a[i]); } return b; } }