Java Integer Create toInt(double[] layer)

Here you can find the source of toInt(double[] layer)

Description

to Int

License

Open Source License

Declaration

public static int toInt(double[] layer) 

Method Source Code

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

public class Main {
    public static int toInt(double[] layer) {
        return toInt(layer, 0, layer.length);
    }//from w w  w . j  a v  a  2 s  .c  o m

    public static int toInt(double[] layer, int si, int ei) {
        int ret = 0;
        for (int i = si; i < ei; i++) {
            ret *= 2;
            if (layer[i] >= 0.5) {
                ret++;
            }
        }
        return ret;
    }
}

Related

  1. toInt(double num)
  2. toInt(double val)
  3. toInt(double value)
  4. toInt(double[] arr)
  5. toInt(double[] array)
  6. toInt(double[] v)
  7. toInt(double[][] data)
  8. toInt(double[][] doubles)
  9. toInt(final Boolean value)