lexical_cast error with double?

31 May
2007
31 May
'07
11:37 a.m.
This may have been posted before, but I did not see it or the solution. This code: double d = 72.35 std::string = boost::lexical_cast<std::string>(d); Results in the string 72.3499999999999999999 However printf("%f\n", d); Results in 72.350000 Any reason for this - or more importantly, any way to fix it and prevent it happening again? PreZ :)
6585
Age (days ago)
6585
Last active (days ago)
0 comments
1 participants
participants (1)
-
Preston A. Elder