Exact binary representation of a double [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Float to binary in C++ I have a very small double var, and when I print it I get -0. (using C++). Now in order to get better precision I tried using cout.precision(18); \\i think 18 is the max precision i can get. cout.setf(ios::fixed,ios::floatfield); cout<<var;\\var is a double. but it just writes -0.00000000000... I want to see the exact binary representation of the var. In other words I want to see what