Bug 14519

Summary: Incorrect sign of zero on strtod underflow
Product: glibc Reporter: Joseph Myers <jsm28>
Component: libcAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: drepper.fsp
Priority: P2 Flags: fweimer: security-
Version: 2.16   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Joseph Myers 2012-08-25 15:36:15 UTC
strtod sometimes returns positive zero on underflow when it should return negative zero.  Testcase:

#include <stdio.h>
#include <stdlib.h>

int
main (void)
{
  printf ("%a\n", atof ("-0x0.7p-1074"));
  return 0;
}

Testing a patch.
Comment 1 Joseph Myers 2012-08-27 16:14:10 UTC
Fixed for 2.17 by:

commit 7efb4737dd729326e5339facbd785cee43fb53b3
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Aug 27 16:04:19 2012 +0000

    Fix sign of zero on strtod underflow (bug 14519).