Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-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
Joined
Jun 26, 2003
Messages
6
Location
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
 
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.

Part and Inventory Search

Sponsor

Back
Top