This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/25498] atof conversion error



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-12-19 23:45 -------
This is called float not having enough precession.  This is not a bug.  Please
read what floating point is.

The full testcase looks like:
#include <stdio.h>
#include <string.h>

#include <stdlib.h>

int main(void)
{
        char currConv[9];
        float currConvf;
        memset(currConv, '\0', sizeof(currConv));
        memcpy(currConv, "60342935", 8);
        currConv[8] = 0;
        currConvf = atof(currConv);
        printf("%f\n", currConvf);
}
-----


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25498


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]