General Question

Waffle's avatar

How do I print the full double in C++?

Asked by Waffle (248points) January 31st, 2009

I’m writing a C++ program and it’s going to eventually output a value stored as a double. The only problem is that whenever I cout the value, it shows up with an exponent (1.84762e+11)

How can I see the entire exact value?

Observing members: 0 Composing members: 0

2 Answers

Perchik's avatar

#include ios;
#include iostream;
#include iomanip;
using namespace std;

int main()
{
double myDouble = “9999999999”;
cout << fixed << setprecision(0)<<myDouble;
}

Waffle's avatar

Thanks!
That worked great!

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther