Java Integer Create toIntArray(double[] a)

Here you can find the source of toIntArray(double[] a)

Description

Converts a double array to an int array.

License

Apache License

Parameter

Parameter Description
a the double array.

Return

an int array.

Declaration

public static int[] toIntArray(double[] a) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*  w w w  . j  a  va  2s . com*/
     * Converts a double array to an int array.
     * 
     * @param a the double array.
     * @return an int array.
     */
    public static int[] toIntArray(double[] a) {
        int[] b = new int[a.length];
        for (int i = 0; i < a.length; i++) {
            b[i] = (int) a[i];
        }
        return b;
    }
}

Related

  1. toIntArray(byte[] data)
  2. toIntArray(byte[] data)
  3. toIntArray(byte[] data, boolean includeLength)
  4. toIntArray(byte[] data, int offset)
  5. toIntArray(byte[] input)
  6. toIntArray(double[] array)
  7. toIntArray(final byte[] array)
  8. toIntArray(final byte[] bytes)
  9. toIntArray(final double[] doubleArray)