This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/13239] New: logl returns wrong values on Linux/SPARC in 64-bit mode
- From: "bruno at clisp dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Fri, 30 Sep 2011 16:01:01 +0000
- Subject: [Bug math/13239] New: logl returns wrong values on Linux/SPARC in 64-bit mode
- Auto-submitted: auto-generated
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.