Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

long-string number in Visual C++

Status
Not open for further replies.

thornybird80

Structural
Jun 26, 2003
6
0
0
CA
Hi, I am working on a project using visual C++. I encounter a problem: when i input a number with a very long string, say 3.444444444444444444444444444444444..., the VC-based program will automatically close without even an error message. Could anyone here give me some hints regarding how to deal with the issue? Thanks.

Bird
 
Replies continue below

Recommended for you

Need far more info than you have presented. How are you entering this string into what type of variable from what form or is it a console app? Are you converting from a string to a number or is it a number field that you are entering the data into? Please post at least a code snippet to give us more info.
 
Do you want to round it ? If you want to preserve the accuracy to so many digits you have to write your own
arithmetic library -- and you can't use the co-processor
-- at least not so easily

<nbucska@pcperipherals.com>
 
Status
Not open for further replies.
Back
Top