Java Utililty Methods Double Convert to

List of utility methods to do Double Convert to

Description

The list of methods to do Double Convert to are organized into topic(s).

Method

voidconvertDoubleValuesFromNetcdf(double[] netcdfData, double missingValue, double scaleFactor, double offSet)
Converts the raw values from a netcdf file to the real values using the given missingValue, scaleFactor and offset.
if (scaleFactor == 1d && offSet == 0d) {
    if (!Double.isNaN(missingValue)) {
        for (int i = 0; i < netcdfData.length; i++) {
            if (Double.compare(netcdfData[i], missingValue) == 0) {
                netcdfData[i] = Double.NaN;
    } else {
...
voiddouble2Arr(double var, byte[] arrayBytes, int startIndex)
Write the bytes of "var" into new byte array.
long bits = Double.doubleToLongBits(var);
long2Arr(bits, arrayBytes, startIndex);
double[][]double2array(int sz, double seed)
doublearray
double[][] ret = new double[sz][sz];
init(ret, seed);
return ret;
byte[]double2bin(double d)
doublebin
return long2bin(Double.doubleToLongBits(d));
boolean[]double2bipolar(final double d[])
doublebipolar
final boolean[] result = new boolean[d.length];
for (int i = 0; i < d.length; i++) {
    result[i] = double2bipolar(d[i]);
return result;
float[]double2dimToFloat1Dim(double[][] points)
doubledim To Float Dim
int nrPoints = points.length;
int sizePoint = points[0].length;
float[] res = new float[nrPoints * sizePoint];
for (int i = 0; i < nrPoints; i++) {
    for (int j = 0; j < sizePoint; j++) {
        res[i * sizePoint + j] = (float) points[i][j];
return res;
intdouble2fixed(double value)
Converts double to fixed value
return (int) (value * FRACTION_DBL);
float[]double2Float(double[] v)
double Float
float f[] = new float[v.length];
for (int i = 0; i < v.length; i++) {
    f[i] = (float) v[i];
return f;
intdouble2int(final double d)
Returns the hash code that would be returned by Double#hashCode() .
final long l = Double.doubleToRawLongBits(d);
return (int) (l ^ (l >>> 32));
longdouble2long(double value)
doublelong
if (value > Long.MAX_VALUE)
    return Long.MAX_VALUE;
if (value < Long.MIN_VALUE)
    return Long.MIN_VALUE;
return (long) value;