android.util
public
final
class
android.util.MathUtils
Summary
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
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().