Here you can find the source of floatToInt(float f, int defaultValue)
public static int floatToInt(float f, int defaultValue)
//package com.java2s; //License from project: LGPL public class Main { public static int floatToInt(float f, int defaultValue) { if (f >= Integer.MIN_VALUE && f <= Integer.MAX_VALUE) { return (int) f; }// ww w . java2 s . c o m return defaultValue; } }