math: fix __fpclassifyl(-0.0) for IEEE binary128
[oweals/musl.git] / src / math / log10l.c
index f0eeeafb4a733a916d45d2b485886c35d5843973..c7aacf909a45156d1f60513f60ee237ad36e8272 100644 (file)
@@ -117,16 +117,15 @@ static const long double S[4] = {
 
 long double log10l(long double x)
 {
-       long double y;
-       volatile long double z;
+       long double y, z;
        int e;
 
        if (isnan(x))
                return x;
        if(x <= 0.0) {
                if(x == 0.0)
-                       return -1.0 / (x - x);
-               return (x - x) / (x - x);
+                       return -1.0 / (x*x);
+               return (x - x) / 0.0;
        }
        if (x == INFINITY)
                return INFINITY;