Here you can find the source of floor(float f)
public static int floor(float f)
//package com.java2s; //License from project: Apache License public class Main { public static int floor(float f) { boolean neg = f < 0; int r = (int) f; if (neg)// ww w.j a v a 2s.c o m r -= 1; return r; } }