Java Double to Short doubleToShort(double[] values)

Here you can find the source of doubleToShort(double[] values)

Description

double To Short

License

Open Source License

Declaration

public static short[] doubleToShort(double[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static short[] doubleToShort(double[] values) {
        if (values == null) {
            return null;
        }/*from www. j  a v a  2 s . c  o  m*/

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

Related

  1. doubleToShort(double d)
  2. doubleToShort(final double value)
  3. doubleToShortBits(double d)