FileDocCategorySizeDatePackage
FastMath.javaAPI DocAndroid 5.1 API1090Thu Mar 12 22:22:10 GMT 2015com.android.internal.util

FastMath

public class FastMath extends Object
Fast and loose math routines.

Fields Summary
Constructors Summary
Methods Summary
public static intround(float value)
Fast round from float to int. This is faster than Math.round() thought it may return slightly different results. It does not try to handle (in any meaningful way) NaN or infinities.

        long lx = (long) (value * (65536 * 256f));
        return (int) ((lx + 0x800000) >> 24);