[Bug libc/18247] New: strtof is not correctly rounded for 2^-150+eps

nszabolcs at gmail dot com sourceware-bugzilla@sourceware.org
Fri Apr 10 12:49:00 GMT 2015


https://sourceware.org/bugzilla/show_bug.cgi?id=18247

            Bug ID: 18247
           Summary: strtof is not correctly rounded for 2^-150+eps
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: nszabolcs at gmail dot com
                CC: drepper.fsp at gmail dot com

strtof should give correctly rounded results, but it fails for half way cases
between the minimum subnormal value and zero.

following code prints:
got 0x0p+0, expected 0x1p-149


#include <stdlib.h>
#include <stdio.h>
int main()
{
float f = strtof(".70064923216240853546186479164495807e-45", 0);
if (f != 0x1p-149)
        printf("got %a, expected 0x1p-149\n", f);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list