English | Site Directory

Android - An Open Handset Alliance Project

android.util
public final class

android.util.MathUtils

java.lang.Object
android.util.MathUtils

Summary

Public Constructors

          MathUtils()

Public Methods

      static  float  ceil(float x)
Return the ceiling of a floating point value.
      static  float  cos(float x)
Return the cosine of a floating point value.
      static  int  fastRound(float x)
Fast round from float to int.
      static  int  fastRound16(float x)
Fast round from float to int.
      static  float  floor(float x)
Return the floor of a floating point value.
      static  float  sin(float x)
Return the sine of a floating point value.
Methods inherited from class java.lang.Object

Details

Public Constructors

public MathUtils()

Public Methods

public static float ceil(float x)

Return the ceiling of a floating point value. This is similar to Math.ceil(), it does all of its computations on the float directly, rather than converting to a double first (as Math.ceil does). Because it avoids the conversion, it should perform faster than Math.ceil().

public static float cos(float x)

Return the cosine of a floating point value. This is similar to Math.cos(), it does all of its computations on the float directly, rather than converting to a double first (as Math.cos does). Because it avoids the conversion, it should perform faster than Math.cos().

public static int fastRound(float x)

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.

public static int fastRound16(float x)

Fast round from float to int. This is faster than Math.round(), and faster than round(), though it is only valid for -32767 <= x <= 32767. It does not try to handle (in any meaningful way) NaN or infinities.

public static float floor(float x)

Return the floor of a floating point value. This is similar to Math.floor(), it does all of its computations on the float directly, rather than converting to a double first (as Math.floor does). Because it avoids the conversion, it should perform faster than Math.floor().

public static float sin(float x)

Return the sine of a floating point value. This is similar to Math.sin(), it does all of its computations on the float directly, rather than converting to a double first (as Math.sin does). Because it avoids the conversion, it should perform faster than Math.sin().
Build m5-rc15i - 10 Jun 2008 13:54