Math Library: math.h

With C99, the math.h header file defines two types:


These types are at least as wide as float and double respectively, and double_t is at least as wide as float_t. These are intended to be the most efficient types for doing float and double calculations, respectively.

This header file also defines several macros, as described in Table RS.V.13; all but HUGE_VAL are C99 additions. Some of these are discussed in more detail in Reference Section VIII, “C99 Numeric Computational Enhancements.”

Table RS.V.13. math.h Macros
Macro Description
HUGE_VAL A positive double constant not necessarily expressible as a float; in the past, it was used as the return value for functions when the magnitude of the result exceeded ...

Get C Primer Plus, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.