unsigned long long value = 0;
bool result = value >= std::numeric_limits<signed int>::min();
This should give true but gives false? Why and how can I fix it?
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.
The int converts to an unsigned int for comparison. You could cast your
unsigned long longto along long.5/9:
…
…
unsigned long longandlong longare not standard types in c++03, but it’s quite likely that the compiler will treat these types using the mechanisms defined above. The mentioned conversion rules would then cover this particular conversion.