Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

FloatMath

extends Object
java.lang.Object
   ↳ android.util.FloatMath

Class Overview

Math routines similar to those found in Math . On versions of Android with a JIT, these are significantly slower than the equivalent Math functions, which should be used in preference to these.

Summary

Public Methods
static float ceil (float value)
Returns the float conversion of the most negative (i.e.
static float cos (float angle)
Returns the closest float approximation of the cosine of the argument.
static float exp (float value)
Returns the closest float approximation of the raising "e" to the power of the argument.
static float floor (float value)
Returns the float conversion of the most positive (i.e.
static float hypot (float x, float y)
Returns sqrt( x 2 + y 2 ) .
static float pow (float x, float y)
Returns the closest float approximation of the result of raising x to the power of y .
static float sin (float angle)
Returns the closest float approximation of the sine of the argument.
static float sqrt (float value)
Returns the closest float approximation of the square root of the argument.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static float ceil (float value)

Added in API level 1

Returns the float conversion of the most negative (i.e. closest to negative infinity) integer value which is greater than the argument.

Parameters
value to be converted
Returns
  • the ceiling of value

public static float cos (float angle)

Added in API level 1

Returns the closest float approximation of the cosine of the argument.

Parameters
angle to compute the cosine of, in radians
Returns
  • the cosine of angle

public static float exp (float value)

Returns the closest float approximation of the raising "e" to the power of the argument.

Parameters
value to compute the exponential of
Returns
  • the exponential of value

public static float floor (float value)

Added in API level 1

Returns the float conversion of the most positive (i.e. closest to positive infinity) integer value which is less than the argument.

Parameters
value to be converted
Returns
  • the floor of value

public static float hypot (float x, float y)

Returns sqrt( x 2 + y 2 ) .

Parameters
x a float number
y a float number
Returns
  • the hypotenuse

public static float pow (float x, float y)

Returns the closest float approximation of the result of raising x to the power of y .

Parameters
x the base of the operation.
y the exponent of the operation.
Returns
  • x to the power of y .

public static float sin (float angle)

Added in API level 1

Returns the closest float approximation of the sine of the argument.

Parameters
angle to compute the cosine of, in radians
Returns
  • the sine of angle

public static float sqrt (float value)

Added in API level 1

Returns the closest float approximation of the square root of the argument.

Parameters
value to compute sqrt of
Returns
  • the square root of value