Here you can find the source of truncateDoubleToInt(double x)
public static int truncateDoubleToInt(double x)
//package com.java2s; //License from project: Open Source License public class Main { public static int truncateDoubleToInt(double x) { return (int) Math.floor(x); }/* w ww . ja v a 2 s . c o m*/ }