Index: src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java =================================================================== --- src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java (revision 475608) +++ src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java (working copy) @@ -316,6 +316,29 @@ } /** + * @tests java.lang.Math#log10(double) + */ + @SuppressWarnings("boxing") + public void test_log10_D() { + // Test for special cases + assertTrue(Double.isNaN(Math.log10(Double.NaN))); + assertTrue(Double.isNaN(Math.log10(-2541.05745687234187532))); + assertTrue(Double.isNaN(Math.log10(-0.1))); + assertEquals(Double.POSITIVE_INFINITY, Math.log10(Double.POSITIVE_INFINITY)); + assertEquals(Double.NEGATIVE_INFINITY, Math.log10(0.0)); + assertEquals(Double.NEGATIVE_INFINITY, Math.log10(+0.0)); + assertEquals(Double.NEGATIVE_INFINITY, Math.log10(-0.0)); + + assertEquals(3.0, Math.log10(1000.0)); + assertEquals(14.0, Math.log10(Math.pow(10, 14))); + assertEquals(3.7389561269540406, Math.log10(5482.2158)); + assertEquals(14.661551142893833, Math.log10(458723662312872.125782332587)); + assertEquals(-0.9083828622192334, Math.log10(0.12348583358871)); + assertEquals(308.25471555991675, Math.log10(Double.MAX_VALUE)); + assertEquals(-323.3062153431158, Math.log10(Double.MIN_VALUE)); + } + + /** * @tests java.lang.Math#log1p(double) */ public void test_log1p_D() { Index: src/main/java/java/lang/Math.java =================================================================== --- src/main/java/java/lang/Math.java (revision 475608) +++ src/main/java/java/lang/Math.java (working copy) @@ -252,10 +252,7 @@ * the value to compute the log10 of * @return the natural logarithm of the argument. */ - public static double log10(double d) { - //TODO: this is a stub to integrate HARMONY-935 - return log(d)/log(10); - } + public static native double log10(double d); /** * Answers the closest double approximation of the natural logarithm of the Index: src/main/native/luni/linux/libhyluni.exp =================================================================== --- src/main/native/luni/linux/libhyluni.exp (revision 475608) +++ src/main/native/luni/linux/libhyluni.exp (working copy) @@ -104,6 +104,7 @@ Java_java_lang_Math_hypot; Java_java_lang_Math_IEEEremainder; Java_java_lang_Math_log; + Java_java_lang_Math_log10; Java_java_lang_Math_log1p; Java_java_lang_Math_nextafter; Java_java_lang_Math_nextafterf; Index: src/main/native/luni/shared/math.c =================================================================== --- src/main/native/luni/shared/math.c (revision 475608) +++ src/main/native/luni/shared/math.c (working copy) @@ -492,6 +492,11 @@ return internal_log10 (arg1); } +jdouble JNICALL +Java_java_lang_Math_log10 (JNIEnv * env, jclass jclazz, jdouble arg1) +{ + return internal_log10 (arg1); +} jdouble JNICALL Java_java_lang_StrictMath_log1p (JNIEnv * env, jclass jclazz, jdouble arg1) Index: src/main/native/luni/windows/hyluni.def =================================================================== --- src/main/native/luni/windows/hyluni.def (revision 475608) +++ src/main/native/luni/windows/hyluni.def (working copy) @@ -97,6 +97,7 @@ Java_java_lang_Math_hypot Java_java_lang_Math_IEEEremainder Java_java_lang_Math_log + Java_java_lang_Math_log10 Java_java_lang_Math_log1p Java_java_lang_Math_nextafter Java_java_lang_Math_nextafterf