Java Double Array Create toDoubleArray(final long[] array)

Here you can find the source of toDoubleArray(final long[] array)

Description

Converts an array of long primitives to an array of doubles.

License

Apache License

Parameter

Parameter Description
array input array of long values.

Return

Same array but with all values as double.

Declaration

public static double[] toDoubleArray(final long[] array) 

Method Source Code

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

public class Main {
    /**/*from  w  ww .j  a v  a 2  s .c  o m*/
     * Converts an array of long primitives to an array of doubles.
     *
     * @param array input array of long values.
     * @return Same array but with all values as double.
     */
    public static double[] toDoubleArray(final long[] array) {
        double[] values = new double[array.length];
        for (int i = 0; i < array.length; i++)
            values[i] = array[i];
        return values;
    }
}

Related

  1. toDoubleArray(boolean[] array)
  2. toDoubleArray(byte[] byteArray)
  3. toDoubleArray(byte[] data)
  4. toDoubleArray(Double[] data)
  5. toDoubleArray(final byte[] array)
  6. toDoubleArray(final Object[] array)
  7. toDoubleArray(int... intArray)
  8. toDoubleArray(int[] ints)
  9. toDoubleArray(Number[] array)