The question is about modeling infinity in C++ for the double data type. I need it in a header file, so we cannot use functions like numeric_limits.
Is there a defined constant that represents the largest value?
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.
floating point numbers(such as doubles) can actually hold positive and negative infinity. The constant INFINITY should be in your math.h header.
Went standard diving and found the text:
In Section
7.12 Mathematics <math.h>Then of course you have the helper function
isinfto test for infinity(which is also in math.h).