am 572a0859: Merge "Add FloatMath.pow." into jb-mr1-dev
* commit '572a0859dd258d2d72588bfd22b750a4322d3b23': Add FloatMath.pow.
This commit is contained in:
@@ -22909,6 +22909,7 @@ package android.util {
|
|||||||
method public static float exp(float);
|
method public static float exp(float);
|
||||||
method public static float floor(float);
|
method public static float floor(float);
|
||||||
method public static float hypot(float, float);
|
method public static float hypot(float, float);
|
||||||
|
method public static float pow(float, float);
|
||||||
method public static float sin(float);
|
method public static float sin(float);
|
||||||
method public static float sqrt(float);
|
method public static float sqrt(float);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,16 @@ public class FloatMath {
|
|||||||
*/
|
*/
|
||||||
public static native float exp(float value);
|
public static native float exp(float value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the closest float approximation of the result of raising {@code
|
||||||
|
* x} to the power of {@code y}.
|
||||||
|
*
|
||||||
|
* @param x the base of the operation.
|
||||||
|
* @param y the exponent of the operation.
|
||||||
|
* @return {@code x} to the power of {@code y}.
|
||||||
|
*/
|
||||||
|
public static native float pow(float x, float y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code +} <i>
|
* Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code +} <i>
|
||||||
* {@code y}</i><sup>{@code 2}</sup>{@code )}.
|
* {@code y}</i><sup>{@code 2}</sup>{@code )}.
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ public:
|
|||||||
return expf(x);
|
return expf(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static float PowF(JNIEnv* env, jobject clazz, float x, float y) {
|
||||||
|
return powf(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
static float HypotF(JNIEnv* env, jobject clazz, float x, float y) {
|
static float HypotF(JNIEnv* env, jobject clazz, float x, float y) {
|
||||||
return hypotf(x, y);
|
return hypotf(x, y);
|
||||||
}
|
}
|
||||||
@@ -42,6 +46,7 @@ static JNINativeMethod gMathUtilsMethods[] = {
|
|||||||
{"cos", "(F)F", (void*) MathUtilsGlue::CosF},
|
{"cos", "(F)F", (void*) MathUtilsGlue::CosF},
|
||||||
{"sqrt", "(F)F", (void*) MathUtilsGlue::SqrtF},
|
{"sqrt", "(F)F", (void*) MathUtilsGlue::SqrtF},
|
||||||
{"exp", "(F)F", (void*) MathUtilsGlue::ExpF},
|
{"exp", "(F)F", (void*) MathUtilsGlue::ExpF},
|
||||||
|
{"pow", "(FF)F", (void*) MathUtilsGlue::PowF},
|
||||||
{"hypot", "(FF)F", (void*) MathUtilsGlue::HypotF},
|
{"hypot", "(FF)F", (void*) MathUtilsGlue::HypotF},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user