C Macro Erange
π
2026-06-14 | π C
[ C Standard Library - ](#)
## Description
The C library macro **ERANGE** indicates a range error, which occurs when an input argument exceeds the domain defined for a mathematical function; in such cases, `errno` is set to `ERANGE`.
`ERANGE` is a macro defined in the C standard library header ``. It is used to indicate errors where the result falls outside the representable range of the functionβcommonly occurring when mathematical or conversion functions produce results that exceed what can be represented.
## Declaration
Below is the declaration of the `ERANGE` macro.
#define ERANGE some_value
## Parameters
* **NA**
## Return Value
* **NA**
## Example
Below are several examples demonstrating the use of `ERANGE` to handle errors arising from results exceeding representable ranges.
### Mathematical Functions
Range errors (`ERANGE`) may occur with mathematical functions such as `exp` or `log`. For instance, computing an extremely large exponent may yield a result beyond the floating-point representation range.
## Example
#include
#include