svn commit: r215237 - head/lib/msun/src

Steve Kargl sgk at troutmask.apl.washington.edu
Sat Nov 13 16:46:46 UTC 2010


On Sat, Nov 13, 2010 at 12:56:48PM +0000, Alexander Best wrote:
> On Sat Nov 13 10, Ulrich Spoerlein wrote:
> > Author: uqs
> > Date: Sat Nov 13 10:54:10 2010
> > New Revision: 215237
> > URL: http://svn.freebsd.org/changeset/base/215237
> > 
> > Log:
> >   Fix bug in jn(3) and jnf(3) that led to -inf results
> 
> thank you very much for fixing this long outstanding issue.
> you might want to have a look at [1], where two more issues have been reported.
> 
> cheers.
> alex
> 
> [1] http://mailman.oakapple.net/pipermail/numeric-interest/2010-September/thread.html
> 

Ulrich, thanks.  Of the two remaining issues, I can verify
one is indeed an issue.

laptop:kargl[204] cat mn.c
#include <stdio.h>
#include <math.h>

static const double z = 0.;

int
main(void)
{
   double x, y;
   x = -1. / z;
   y = exp( 0.5 * log(x));
   printf("pow(%f,  0.5) = %le, %le\n", x, pow(x,  0.5), y);
   y = exp(-0.5 * log(x));
   printf("pow(%f, -0.5) = %le, %le\n", x, pow(x, -0.5), y);
   return 0;
}

laptop:kargl[205] cc -o z mn.c -fno-builtin -lm && ./z
pow(-inf,  0.5) = inf, nan
pow(-inf, -0.5) = 0.000000e+00, nan

-- 
Steve


More information about the svn-src-all mailing list