diff --git a/build.sbt b/build.sbt index a0eeb512..390cb944 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ import android.Keys._ android.Plugin.androidBuild -platformTarget in Android := "android-22" +platformTarget in Android := "android-23" name := "shadowsocks" diff --git a/project/plugins.sbt b/project/plugins.sbt index d71a8428..1a3d6e1c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ resolvers += Resolver.url("scalasbt releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns) -addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.5.0") +addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.5.1") resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/" diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 30704809..622da321 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -14,7 +14,7 @@ + android:targetSdkVersion="23"/> Historically these methods were faster than the equivalent double-based + * {@link java.lang.Math} methods. On versions of Android with a JIT they + * became slower and have since been re-implemented to wrap calls to + * {@link java.lang.Math}. {@link java.lang.Math} should be used in + * preference. + * + * @deprecated Use {@link java.lang.Math} instead. + */ +@Deprecated +public class FloatMath { + + /** Prevents instantiation. */ + private FloatMath() {} + + /** + * Returns the float conversion of the most positive (i.e. closest to + * positive infinity) integer value which is less than the argument. + * + * @param value to be converted + * @return the floor of value + */ + public static float floor(float value) { + return (float) Math.floor(value); + } + + /** + * Returns the float conversion of the most negative (i.e. closest to + * negative infinity) integer value which is greater than the argument. + * + * @param value to be converted + * @return the ceiling of value + */ + public static float ceil(float value) { + return (float) Math.ceil(value); + } + + /** + * Returns the closest float approximation of the sine of the argument. + * + * @param angle to compute the cosine of, in radians + * @return the sine of angle + */ + public static float sin(float angle) { + return (float) Math.sin(angle); + } + + /** + * Returns the closest float approximation of the cosine of the argument. + * + * @param angle to compute the cosine of, in radians + * @return the cosine of angle + */ + public static float cos(float angle) { + return (float) Math.cos(angle); + } + + /** + * Returns the closest float approximation of the square root of the + * argument. + * + * @param value to compute sqrt of + * @return the square root of value + */ + public static float sqrt(float value) { + return (float) Math.sqrt(value); + } + + /** + * Returns the closest float approximation of the raising "e" to the power + * of the argument. + * + * @param value to compute the exponential of + * @return the exponential of value + */ + public static float exp(float value) { + return (float) Math.exp(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 float pow(float x, float y) { + return (float) Math.pow(x, y); + } + + /** + * Returns {@code sqrt(}{@code x}{@code 2}{@code +} + * {@code y}{@code 2}{@code )}. + * + * @param x a float number + * @param y a float number + * @return the hypotenuse + */ + public static float hypot(float x, float y) { + return (float) Math.hypot(x, y); + } +}