X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flog10l.c;h=03e1ce5bf66020f6b5bcff34b8ca9b317474d30a;hb=43593319b31e6b0175b8eec4433bac744959822d;hp=ecaacb217f2456582513ebd6c5d5ab91d5dda254;hpb=57649867fd53a99f547e0d4ad6bb19b21330516c;p=gnulib.git diff --git a/lib/log10l.c b/lib/log10l.c index ecaacb217..03e1ce5bf 100644 --- a/lib/log10l.c +++ b/lib/log10l.c @@ -1,5 +1,5 @@ /* Base 10 logarithmic function. - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,29 @@ log10l (long double x) return log10 (x); } +#elif HAVE_LOG10L + +# include + +long double +log10l (long double x) +# undef log10l +{ + /* Work around the OSF/1 5.1 bug. */ + if (x == 0.0L) + /* Return -Infinity. */ + return -1.0L / 0.0L; + { + long double y = log10l (x); +# ifdef __sgi + /* Normalize the +Infinity value. */ + if (y > LDBL_MAX) + y = 1.0L / 0.0L; +# endif + return y; + } +} + #else /* 1 / log(10) */