Why atof(1.8) returns 1.79999

char str[128];
double retVal = atof(str);

str value is "1.80 ; some_text". Why atof returns 1.79999?

Visual C++ 2008 Express, Windows 7/64

Best regards,
Peter
You never get much precision with floating point arithmetic
Topic archived. No new replies allowed.