This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25498] atof conversion error
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2005 00:49:29 -0000
- Subject: [Bug c/25498] atof conversion error
- References: <bug-25498-11903@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pinskia at gcc dot gnu dot org 2005-12-20 00:49 -------
Try the following program:
#include <stdio.h>
int main(void)
{
float currConvf = 60342935.0;
printf("%f\n", currConvf);
}
And you will see that you get 60342936.0.
The number of bits needed to represent 60342935 is one too many to fit into
float.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25498