[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: double variables



> how can I cout the value of a double with setprecision
> in c++ without the number being rounded at all.
> for example:
>
> #include <iostream>
> #include <iomanip>
>
> using namespace std;
> main(){
>
> double num = 8.5732;
>
> cout << setprecision(3) << num;
>
> return 0;
> }

Boy did you get me thinking ... to tell you the truth ... without putting it
all in place holders via an array or pointer ... I don't see how you really
could ...

just out of curiosity ... is this something that's bugging you ... or a
professor that gave it as an assignment? :-)

SuperDuG

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.