Java examples for java.lang:Math Function
A faster floor implementation that Math.floor.
//package com.java2s; public class Main { /**// w w w. j a va 2 s . c o m * A faster floor implementation that Math.floor. * @param x The to floor value * @return The floored value */ public static int fastFloor(double x) { int xi = (int) x; return x < xi ? xi - 1 : xi; } }