I would like to return +INF but instead, I am only returning “inf”:
int main(void)
{
double dubb = HUGE_VAL;
printf("%f \n", dubb);
}
Am I overlooking something here? Or it is just compiler semantics?
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.
Use
printf("%+F\n", dubb);instead‘+’ makes printf display the sign
‘F’ makes inf/nan uppercase