Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2c279e8 authored by Jeff Brown's avatar Jeff Brown
Browse files

Add FloatMath.pow.

Change-Id: I5c584f4894caba47fccfa22ba95f8665990d516c
parent 5356c7dc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22896,6 +22896,7 @@ package android.util {
    method public static float exp(float);
    method public static float floor(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 sqrt(float);
  }
+10 −0
Original line number Diff line number Diff line
@@ -81,6 +81,16 @@ public class FloatMath {
     */
    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>
     * {@code y}</i><sup>{@code 2}</sup>{@code )}.
+5 −0
Original line number Diff line number Diff line
@@ -30,6 +30,10 @@ public:
        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) {
        return hypotf(x, y);
    }
@@ -42,6 +46,7 @@ static JNINativeMethod gMathUtilsMethods[] = {
    {"cos", "(F)F", (void*) MathUtilsGlue::CosF},
    {"sqrt", "(F)F", (void*) MathUtilsGlue::SqrtF},
    {"exp", "(F)F", (void*) MathUtilsGlue::ExpF},
    {"pow", "(FF)F", (void*) MathUtilsGlue::PowF},
    {"hypot", "(FF)F", (void*) MathUtilsGlue::HypotF},
};