Java Double Convert to convertDoubleToFloat(final double[][] doubleSeries)

Here you can find the source of convertDoubleToFloat(final double[][] doubleSeries)

Description

convert Double To Float

License

Open Source License

Declaration

public static float[][] convertDoubleToFloat(final double[][] doubleSeries) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (C) 2005, 2016 Wolfgang Schramm and Contributors
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation version 2 of the License./*from   w ww.  j  ava 2s  .c o m*/
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 *******************************************************************************/

public class Main {
    public static float[][] convertDoubleToFloat(final double[][] doubleSeries) {

        final float[][] floatSeries = new float[doubleSeries.length][];

        for (int serieIndex = 0; serieIndex < doubleSeries.length; serieIndex++) {

            final double[] doubleValues = doubleSeries[serieIndex];
            if (doubleValues != null) {

                final float[] floatSerie = floatSeries[serieIndex] = new float[doubleValues.length];

                for (int floatIndex = 0; floatIndex < floatSerie.length; floatIndex++) {
                    floatSeries[serieIndex][floatIndex] = (float) doubleValues[floatIndex];
                }
            }
        }
        return floatSeries;
    }
}

Related

  1. convertDoubles(Double[] doubles)
  2. convertDoubleShareToString(double shares)
  3. convertDoubleSizeToViPRLong(double size)
  4. convertDoublesToFloats(double[] input)
  5. convertdoubleToDouble(double[][] dbleArray)
  6. convertDoubleToLong(Double value)
  7. convertDoubleToPercentage(double doub)
  8. convertDoubleToShort(double value)
  9. convertDoubleValuesFromNetcdf(double[] netcdfData, double missingValue, double scaleFactor, double offSet)