public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/13239] New: logl returns wrong values on Linux/SPARC in 64-bit mode
@ 2011-09-30 16:01 bruno at clisp dot org
  2011-09-30 16:02 ` [Bug math/13239] " bruno at clisp dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bruno at clisp dot org @ 2011-09-30 16:01 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13239

             Bug #: 13239
           Summary: logl returns wrong values on Linux/SPARC in 64-bit
                    mode
           Product: glibc
           Version: 2.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: bruno@clisp.org
    Classification: Unclassified


The logl() function from -lm returns wrong values on Linux 2.6.26 with
glibc 2.7.

The test program computes logl(0.6). The multiprecision value is
-0.51082562376599068320551409630366193487811079644...

================================ foo.c ===============================
#include <math.h>
#include <stdio.h>
volatile long double x;
long double y;
int
main ()
{
  x = 0.6L;
  y = logl (x);
  printf ("logl(0.6) = %.16g\n          = %.32Lg\n", (double)y, y);
  if (!(y >= -0.5108256238L && y <= -0.5108256237L))
    {
      printf ("not within expected bounds!\n");
      return 1;
    }
  return 0;
}
======================================================================

Result on Linux/SPARC in 64-bit mode:
$ gcc -m64 foo.c -lm 
$ ./a.out 
logl(0.6) = 2977044471.308746
          = 2977044471.3087464477296220972981
not within expected bounds!

Result on Linux/SPARC in 32-bit mode:
$ gcc -m32 foo.c -lm 
$ ./a.out 
logl(0.6) = -0.5108256237659907
          = -0.51082562376599068320551409630366

Result on Linux/x86_64:
logl(0.6) = -0.5108256237659907
          = -0.51082562376599068319294252860097

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-27 11:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-30 16:01 [Bug math/13239] New: logl returns wrong values on Linux/SPARC in 64-bit mode bruno at clisp dot org
2011-09-30 16:02 ` [Bug math/13239] " bruno at clisp dot org
2011-09-30 16:03 ` bruno at clisp dot org
2011-09-30 17:49 ` bruno at clisp dot org
2011-09-30 17:52 ` bruno at clisp dot org
2011-10-07 23:05 ` davem at davemloft dot net
2011-10-12 12:39 ` aj at suse dot de
2011-10-12 18:55 ` davem at davemloft dot net
2014-06-27 11:59 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).