Java Integer Create toInt(double f)

Here you can find the source of toInt(double f)

Description

Convert a double into an int

License

Open Source License

Declaration

public static int toInt(double f) 

Method Source Code

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

public class Main {
    /** Convert a double into an int */
    public static int toInt(double f) {
        return (f - (double) ((int) f) < 0.5) ? (int) f : (int) f + 1;
    }//  w  w  w  .  ja v a  2 s.c  o  m
}

Related

  1. toInt(char msc, char lsc)
  2. toInt(char[] bytes, boolean le)
  3. toInt(double d)
  4. toInt(double d)
  5. toInt(double d)
  6. toInt(double in)
  7. toInt(double num)
  8. toInt(double val)
  9. toInt(double value)