Java Double to Int doubleToInt(double d, int defaultValue)

Here you can find the source of doubleToInt(double d, int defaultValue)

Description

double To Int

License

LGPL

Declaration

public static int doubleToInt(double d, int defaultValue) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static int doubleToInt(double d, int defaultValue) {
        if (d >= Integer.MIN_VALUE && d <= Integer.MAX_VALUE) {
            return (int) d;
        }//from   www.  ja v  a2 s .c  om
        return defaultValue;
    }
}

Related

  1. doubleToInt(double d, boolean floor)
  2. doubleToInt(double dble)
  3. doubleToInt(double deg)
  4. doubleToInt(double[] doubles)
  5. doubleToInt(double[] values)