When I call get_d() on a MPQ variable in the GMP library, I only get at most six digits.
C++ is supposed to provide 8 bytes or ~15 digits for doubles. Why am I only getting six digits?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I found out why six digits was standard –
by default, when outputting doubles in C++ using cout, the precision is set to six significant figures. You can modify this precision by doing the following:
The output will be 12.32576158.