Java Float Number Create toFloat(double[] v)

Here you can find the source of toFloat(double[] v)

Description

to Float

License

Open Source License

Declaration

public static float[] toFloat(double[] v) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static float[] toFloat(double[] v) {
        final float[] ans = new float[v.length];
        for (int k = 0; k < v.length; k++)
            ans[k] = (float) v[k];
        return (ans);
    }// ww w . ja  v  a  2  s.  c  o m

    public static float[] toFloat(long[] v) {
        final float[] ans = new float[v.length];
        for (int k = 0; k < v.length; k++)
            ans[k] = (float) v[k];
        return (ans);
    }

    public static float[] toFloat(int[] v) {
        final float[] ans = new float[v.length];
        for (int k = 0; k < v.length; k++)
            ans[k] = (float) v[k];
        return (ans);
    }

    public static float[][] toFloat(double[][] v) {
        final float[][] ans = new float[v.length][];
        for (int k = 0; k < v.length; k++)
            ans[k] = toFloat(v[k]);
        return (ans);
    }

    public static float[][] toFloat(long[][] v) {
        final float[][] ans = new float[v.length][];
        for (int k = 0; k < v.length; k++)
            ans[k] = toFloat(v[k]);
        return (ans);
    }

    public static float[][] toFloat(int[][] v) {
        final float[][] ans = new float[v.length][];
        for (int k = 0; k < v.length; k++)
            ans[k] = toFloat(v[k]);
        return (ans);
    }
}

Related

  1. toFloat(byte[][] a)
  2. toFloat(double in1)
  3. toFloat(double[] a)
  4. toFloat(double[] a)
  5. toFloat(double[] in)
  6. toFloat(final byte[] ba)
  7. toFloat(final byte[] inputBytes, final int offset)
  8. toFloat(final Integer value)
  9. toFloat(final Object o, final String pattern)