Java Integer Array Convert To copySignedIntToDoubleArray(int[] src)

Here you can find the source of copySignedIntToDoubleArray(int[] src)

Description

Copy an array of signed values in int, into an array of double.

Sign extension is performed.

License

Open Source License

Parameter

Parameter Description
src an array of int, whose values are interpreted as signed

Return

an array of double

Declaration

static public double[] copySignedIntToDoubleArray(int[] src) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*  w  w  w .  j  a va2 s .co  m*/
     * <p>Copy an array of signed values in int, into an array of double.</p>
     *
     * <p>Sign extension is performed.</p>
     *
     * @param   src   an array of int, whose values are interpreted as signed
     * @return      an array of double
     */
    static public double[] copySignedIntToDoubleArray(int[] src) {
        if (src == null)
            return null;
        int n = src.length;
        double[] dst = new double[n];
        for (int j = 0; j < n; ++j) {
            dst[j] = src[j]; // allow sign extension
        }
        return dst;
    }
}

Related

  1. copySignedIntToShortArray(int[] src)
  2. intArray2HashCode(int[] xs)
  3. intArray2HexString(int[] intArray)
  4. intArray2IntegerArray(int[] array, int newLength)