×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

long-string number in Visual C++

long-string number in Visual C++

long-string number in Visual C++

(OP)
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

RE: long-string number in Visual C++

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.

RE: long-string number in Visual C++

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>

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources