Here you can find the source of floatToLong(float f)
public static Long floatToLong(float f)
//package com.java2s; //License from project: LGPL public class Main { public static Long floatToLong(float f) { if (f >= Long.MIN_VALUE && f <= Long.MAX_VALUE) { return (long) f; }/* www . j av a2 s . com*/ return null; } public static long floatToLong(float f, long defaultValue) { if (f >= Long.MIN_VALUE && f <= Long.MAX_VALUE) { return (long) f; } return defaultValue; } }