[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#788681: marked as done (libc6: Function remquo() is broken)



Your message dated Mon, 7 Mar 2016 19:29:43 +0100
with message-id <20160307182943.GA28646@aurel32.net>
and subject line Re: libc6: Function remquo() is broken
has caused the Debian Bug report #788681,
regarding libc6: Function remquo() is broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
788681: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=788681
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- 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 ---
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 ---

Reply to: