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

Commit 270e3381 authored by Jeff Brown's avatar Jeff Brown
Browse files

Add FloatMath.hypot.

Change-Id: I6a5a7ea2254300614dbbf540f40e39dbec2d2900
parent 06565b64
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22876,6 +22876,7 @@ package android.util {
    method public static float cos(float);
    method public static float exp(float);
    method public static float floor(float);
    method public static float hypot(float, float);
    method public static float sin(float);
    method public static float sqrt(float);
  }
+10 −0
Original line number Diff line number Diff line
@@ -80,4 +80,14 @@ public class FloatMath {
     * @return the exponential of value
     */
    public static native float exp(float value);

    /**
     * Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code +} <i>
     * {@code y}</i><sup>{@code 2}</sup>{@code )}.
     *
     * @param x a float number
     * @param y a float number
     * @return the hypotenuse
     */
    public static native float hypot(float x, float y);
}
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,10 @@ public:
    static float ExpF(JNIEnv* env, jobject clazz, float x) {
        return expf(x);
    }

    static float HypotF(JNIEnv* env, jobject clazz, float x, float y) {
        return hypotf(x, y);
    }
};

static JNINativeMethod gMathUtilsMethods[] = {
@@ -38,6 +42,7 @@ static JNINativeMethod gMathUtilsMethods[] = {
    {"cos", "(F)F", (void*) MathUtilsGlue::CosF},
    {"sqrt", "(F)F", (void*) MathUtilsGlue::SqrtF},
    {"exp", "(F)F", (void*) MathUtilsGlue::ExpF},
    {"hypot", "(FF)F", (void*) MathUtilsGlue::HypotF},
};

int register_android_util_FloatMath(JNIEnv* env)