X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flogf.c;h=f2d5250f61f072ea10c15417c79ef4245aeae0f1;hb=14a3c6e4da8e6c5e65d0bba54cd42a91fd582603;hp=3bf0f138feba388c1d1e42d1f3f99d50727882f6;hpb=204f9216c0518251439234fe17bd2f7798156aa3;p=gnulib.git diff --git a/lib/logf.c b/lib/logf.c index 3bf0f138f..f2d5250f6 100644 --- a/lib/logf.c +++ b/lib/logf.c @@ -24,10 +24,17 @@ logf (float x) #undef logf { #if HAVE_LOGF - /* Work around the OSF/1 5.1 bug. */ - if (x == 0.0f) - /* Return -Infinity. */ - return -1.0f / 0.0f; + if (x <= 0.0f) + { + /* Work around the OSF/1 5.1 bug. */ + if (x == 0.0f) + /* Return -Infinity. */ + return -1.0f / 0.0f; + /* Work around the NetBSD 5.1 bug. */ + else /* x < 0.0 */ + /* Return NaN. */ + return 0.0f / 0.0f; + } return logf (x); #else return (float) log ((double) x);