Java Double Array Convert doubleArrayToIntArray(double[] doubles)

Here you can find the source of doubleArrayToIntArray(double[] doubles)

Description

double Array To Int Array

License

LGPL

Declaration

public static int[] doubleArrayToIntArray(double[] doubles) 

Method Source Code

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

public class Main {
    public static int[] doubleArrayToIntArray(double[] doubles) {
        int[] ret = new int[doubles.length * 2];
        for (int i = 0; i < doubles.length; i++) {
            long l = Double.doubleToLongBits(doubles[i]);
            ret[i] = (int) (l >>> 32);
            ret[i + 1] = (int) l;
        }//from  w  w w .j a  v  a2 s  . c  o  m
        return ret;
    }
}

Related

  1. doubleArrayToBytes(double[] d)
  2. doubleArrayToClassNames(int[] labels, String[] classNames, Character separatorChar)
  3. doubleArrayToFloatArray(double[] doubleArray)