X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flog.c;h=4c824d4c37823bb092efd2cc37a4f9ae8c4605d2;hb=daf7f8c02242c535d596231e2f655109b97fa2bc;hp=960ec82b5c4b05e54d3c32149bbe6e33ef088ecd;hpb=0d37a2e60081400c4ecefbb106e8a1749b3de2b0;p=gnulib.git diff --git a/lib/log.c b/lib/log.c index 960ec82b5..4c824d4c3 100644 --- a/lib/log.c +++ b/lib/log.c @@ -23,9 +23,16 @@ double log (double x) #undef log { - /* Work around the OSF/1 5.1 bug. */ - if (x == 0.0) - /* Return -Infinity. */ - return -1.0 / 0.0; + if (x <= 0.0) + { + /* Work around the OSF/1 5.1 bug. */ + if (x == 0.0) + /* Return -Infinity. */ + return -1.0 / 0.0; + /* Work around the NetBSD 5.1, Solaris 11 2011-11 bug. */ + else /* x < 0.0 */ + /* Return NaN. */ + return 0.0 / 0.0; + } return log (x); }