CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Posts
    1

    Angry Double datatype roundoff

    Hi ,

    I have a problem with storing value as double data type in C++.

    Please refer the below example for more clarity

    double dVal = 10.23541453;
    cout<<"Value is "<<dVal<<endl;

    The out put will be 10.2354
    The part after 10.2354 is getting round off.
    But for my particular requirement I need the whole value, means I need to avoid the round off.
    Please help me

    Thanks
    Pradeep Kurian

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Double datatype roundoff

    It's only being rounded during output. Its value within the program remains the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured