X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flog.c;h=4c824d4c37823bb092efd2cc37a4f9ae8c4605d2;hb=810183441d657ca09f906ee4d916ac55a1b6127f;hp=960ec82b5c4b05e54d3c32149bbe6e33ef088ecd;hpb=370a139a641c5f9c659e44ee1554893f7d87e20f;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); }