Bug#448723: libc6: strtod("-0", 0) returns +0.0 instead of -0.0
Package: libc6
Version: 2.6.1-6
Severity: normal
In new versions of libc6, strtod("-0", 0) returns +0.0 instead of -0.0
(this bug isn't present in etch).
Discussion:
https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-group-l&id=11150
https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-group-l&id=11151
https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-group-l&id=11156
https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-group-l&id=11159
https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-group-l&id=11160
Here's a program from the one written by Glenn Fowler:
#include <stdio.h>
#include <stdlib.h>
#define SHOW(f) show (#f,f)
static void show (const char *s, double x)
{
double y = strtod (s, 0);
printf ("%-3s %3g %3g\n", s, x, y);
}
int main (void)
{
SHOW(-0);
SHOW(-0.);
return 0;
}
In unstable, I get:
-0 0 0
-0. -0 -0
instead of:
-0 0 -0
-0. -0 -0
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.22-1-686-bigmem (SMP w/2 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.ISO8859-1 (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages libc6 depends on:
ii libgcc1 1:4.2.2-3 GCC support library
libc6 recommends no packages.
-- debconf information excluded
Reply to: