--- Begin Message ---
Package: libc6
Version: 2.19-19
Severity: normal
Dear Maintainer,
function remquo() in libm 64 bit is broken. You can proof this with the
following C code:
----
#include <stdio.h>
#include <math.h>
int main(void)
{
double x, y, z;
int i;
x = 777777777777.0;
y = 5.0;
z = remquo(x, y, &i);
printf("remquo(%f, %f) = %f; q = %d\n", x, y, z, i);
return 0;
}
----
Calculating remquo() with:
x = 777777777777.0
y = 5.0
Correct values are:
rem = 2.0
quo = 155555555555 = 0x2437D568E3 = 0x3 (least low order bits)
----
libm 32 bit yields (gcc -O0 -m32 ... -lm):
rem = 2.0
quo = 3
This result is OK.
----
gcc 32/64 bit with builtin remquo() yields (gcc -O2 -m32 ... ):
rem = 2.0
quo = 936732899 = 0x37D568E3
This result is OK, but there are too many bits in quo. No matter...
----
libm 64 bit yields (gcc -O0 -m64 ... -lm):
rem = 777777777737.0
quo = 8
This result ist completely wrong!
-- System Information:
Debian Release: stretch/sid
APT prefers testing-proposed-updates
APT policy: (500, 'testing-proposed-updates'), (500, 'stable-updates'), (500, 'proposed-updates'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
--- End Message ---
--- Begin Message ---
- To: Jens Schmidt <crashdump@meine-dateien.info>
- Cc: 788681-done@bugs.debian.org
- Subject: Re: libc6: Function remquo() is broken
- From: Aurelien Jarno <aurelien@aurel32.net>
- Date: Mon, 7 Mar 2016 19:29:43 +0100
- Message-id: <20160307182943.GA28646@aurel32.net>
- In-reply-to: <20150614081725.26898.348.reportbug@sirius.lan>
- References: <20150614081725.26898.348.reportbug@sirius.lan>
Version: 2.22-1
On 2015-06-14 10:17, Jens Schmidt wrote:
> Package: libc6
> Version: 2.19-19
> Severity: normal
>
> Dear Maintainer,
>
> function remquo() in libm 64 bit is broken. You can proof this with the
> following C code:
>
> ----
> #include <stdio.h>
> #include <math.h>
>
> int main(void)
> {
> double x, y, z;
> int i;
>
> x = 777777777777.0;
> y = 5.0;
>
> z = remquo(x, y, &i);
>
> printf("remquo(%f, %f) = %f; q = %d\n", x, y, z, i);
>
> return 0;
> }
>
> ----
>
> Calculating remquo() with:
>
> x = 777777777777.0
> y = 5.0
>
> Correct values are:
>
> rem = 2.0
> quo = 155555555555 = 0x2437D568E3 = 0x3 (least low order bits)
>
> ----
> libm 32 bit yields (gcc -O0 -m32 ... -lm):
>
> rem = 2.0
> quo = 3
>
> This result is OK.
> ----
>
> gcc 32/64 bit with builtin remquo() yields (gcc -O2 -m32 ... ):
>
> rem = 2.0
> quo = 936732899 = 0x37D568E3
>
> This result is OK, but there are too many bits in quo. No matter...
> ----
>
> libm 64 bit yields (gcc -O0 -m64 ... -lm):
>
> rem = 777777777737.0
> quo = 8
>
> This result ist completely wrong!
This bug has been fixed in glibc version 2.22. I am therefore marking
the bug as fix in this version.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
--- End Message ---