Click here to Skip to main content
15,898,993 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Cstring to char Pin
Rajesh R Subramanian5-Mar-10 7:40
professionalRajesh R Subramanian5-Mar-10 7:40 
Questionvector in space Pin
khomeyni5-Mar-10 7:03
khomeyni5-Mar-10 7:03 
AnswerRe: vector in space PinPopular
Chris Losinger5-Mar-10 7:21
professionalChris Losinger5-Mar-10 7:21 
GeneralRe: vector in space Pin
khomeyni5-Mar-10 17:04
khomeyni5-Mar-10 17:04 
QuestionHow could I change the CMFCPropertyGridCtrl Property or value column width Pin
A&Ms5-Mar-10 6:49
A&Ms5-Mar-10 6:49 
AnswerRe: How could I change the CMFCPropertyGridCtrl Property or value column width Pin
jung-kreidler11-Sep-11 20:36
jung-kreidler11-Sep-11 20:36 
GeneralRe: How could I change the CMFCPropertyGridCtrl Property or value column width Pin
Martial Spirit15-Jul-21 22:55
Martial Spirit15-Jul-21 22:55 
Questionatof doesn't convert exactly [Solved] Pin
b-rad3115-Mar-10 6:17
b-rad3115-Mar-10 6:17 
Hi,

Does anyone know of a class in c++ or a workaround to the following problem when using the atof function?

I'm reading strings of values from an input file, then parsing the string into several substrings.
Then I take the substrings and attempt to convert them to doubles using atof. It works great most of the time, but everynow and then the atof function can't exactly represent a value and you may get "9.199999999999999" instead of the exact value in the string which is "9.2", or "0.5520000000000001" instead of "0.552".

Also, I can't just set the precision because some of the substrings may contain integers or doubles with a varying number of decimal places (ex. "9" or "9.321").

Any ideas?

Thanks,
modified on Friday, March 19, 2010 10:14 AM

AnswerRe: atof doesn't convert exactly PinPopular
Luc Pattyn5-Mar-10 6:31
sitebuilderLuc Pattyn5-Mar-10 6:31 
QuestionHow to add Messsage After installling Application using MSI Pin
am 20095-Mar-10 3:53
am 20095-Mar-10 3:53 
AnswerRe: How to add Messsage After installling Application using MSI Pin
Richard Andrew x645-Mar-10 15:31
professionalRichard Andrew x645-Mar-10 15:31 
QuestionStructure/Class member addresses Pin
Mike the Red5-Mar-10 2:58
Mike the Red5-Mar-10 2:58 
AnswerRe: Structure/Class member addresses Pin
CPallini5-Mar-10 3:22
mveCPallini5-Mar-10 3:22 
GeneralThanks, Pallini! -nt- Pin
Mike the Red5-Mar-10 3:43
Mike the Red5-Mar-10 3:43 
AnswerRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 4:12
sitebuilderLuc Pattyn5-Mar-10 4:12 
AnswerRe: Structure/Class member addresses Pin
Saurabh.Garg5-Mar-10 4:19
Saurabh.Garg5-Mar-10 4:19 
GeneralRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 4:25
sitebuilderLuc Pattyn5-Mar-10 4:25 
GeneralRe: Structure/Class member addresses Pin
Saurabh.Garg5-Mar-10 4:37
Saurabh.Garg5-Mar-10 4:37 
GeneralRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 4:50
sitebuilderLuc Pattyn5-Mar-10 4:50 
GeneralRe: Structure/Class member addresses Pin
CPallini5-Mar-10 5:26
mveCPallini5-Mar-10 5:26 
GeneralRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 5:32
sitebuilderLuc Pattyn5-Mar-10 5:32 
GeneralRe: Structure/Class member addresses Pin
CPallini5-Mar-10 5:59
mveCPallini5-Mar-10 5:59 
GeneralRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 6:05
sitebuilderLuc Pattyn5-Mar-10 6:05 
GeneralRe: Structure/Class member addresses Pin
CPallini5-Mar-10 6:24
mveCPallini5-Mar-10 6:24 
AnswerRe: Structure/Class member addresses Pin
Avi Berger5-Mar-10 5:11
Avi Berger5-Mar-10 5:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.