|
-
September 4th, 2008, 10:52 AM
#25
Re: Double output problem
 Originally Posted by Lindley
http://www.cplusplus.com/reference/i...precision.html
If you don't specify fixed-point, then setprecision specifies the maximum number of meaningful digits to display. If the value is 1875.11, and you say setprecision(2), then it's only going to display 1 and 8----and the best way to do that is to write 1.8e3.
Of you do specify fixed-point, then the meaning of setprecision() changes to be the number of digits after the decimal to display.
Somehow, that seems like something our professor should have distinguished. He just used it like it determined decimal places and didn't affect the number at all.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|