Modeling infinity for the largest double value

后端 未结 9 1420
予麋鹿
予麋鹿 2020-12-31 05:10

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

9条回答
  •  無奈伤痛
    2020-12-31 05:58

    DBL_MAX can be used. This is found in float.h as follows

        #define DBL_MAX         1.7976931348623158e+308 /* max value */
    

提交回复
热议问题