I am just curious about something.
I have the following code:
if (d1 == 2.3) cout << "2.3 is my value\n"; if (d1 == 2.2999999999999998) cout << "2.2999999999999998 is my value\n"; VS2013 c++11 screenshots


And it goes into both ifs. I know the precision for double is with 15decimals, so I will have to use a more appropiated type for this kind of data.
Could anybody link me a detailed reference? And also a "way" to storage just "2.3" or a data with more precision than 2.2999999999999998? (long double throws me complie error
Error 1 error C2398: Element '1': conversion from 'long double' to 'const std::complex<double>::_Ty &' requires a narrowing conversion... Thanks.
Edit: Added complex

complex<long double>?