Here you can find the source of doublesToLongs(final double[] array)
Parameter | Description |
---|---|
array | the array of double |
public static final long[] doublesToLongs(final double[] array)
//package com.java2s; //License from project: MIT License public class Main { /**/*ww w . ja va 2 s . c om*/ * convert an array of {@code double} values to an array of {@code long}. * * @param array * the array of {@code double} * @return the array of {@code long} */ public static final long[] doublesToLongs(final double[] array) { final long[] res; int i; res = new long[array.length]; i = 0; for (final double x : array) { res[i++] = ((long) x); } return res; } }