Submitter: Douglas Walls (US)
Submission Date: 2003-02-11
Source: J11
Reference Document: ISO/IEC WG14 N995
Version: 1.0
Date: 2003-02-11
Subject: Does <math.h> define INT_MIN and INT_MAX?
Summary
<math.h> defines macros in terms of INT_MIN and INT_MAX. <math.h> defines functions returning the value of INT_MIN. It is unclear if inclusion of <math.h> defines INT_MIN and INT_MAX or also includes <limits.h>.
Details
The description of <math.h> in C99 (section 7.12) says that the macros FP_ILOGB0 and FP_ILOGBNAN are defined in <math.h> with values, respectively INT_MIN or -INT_MAX and INT_MAX or INT_MIN, but never says that INT_MIN and INT_MAX are defined in <math.h>.
The synopsis of 7.12.6.5 The ilogb function says:
#include <math.h> int ilogb(double x); int ilogbf(float x); int ilogbl(long double x);The description of 7.12.6.5 The ilogb functions says "if x is infinite they compute the value INT_MAX;".
Does this mean that <math.h> includes <limits.h>?
Does this mean that <math.h> defines INT_MIN and INT_MAX?
Suggested Technical Corrigendum