Java Float to Short floatToShort(float[] values)

Here you can find the source of floatToShort(float[] values)

Description

float To Short

License

Open Source License

Declaration

public static short[] floatToShort(float[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static short[] floatToShort(float[] values) {
        if (values == null) {
            return null;
        }//from w w  w. j  a v a  2s . c  om

        short[] results = new short[values.length];
        for (int i = 0; i < values.length; i++) {
            results[i] = (short) values[i];
        }
        return results;
    }
}

Related

  1. floatToShort(final float value)
  2. floatToShort(float f)