
- The C Standard Library
- C Library - Home
- C Library - <assert.h>
- C Library - <ctype.h>
- C Library - <errno.h>
- C Library - <float.h>
- C Library - <limits.h>
- C Library - <locale.h>
- C Library - <math.h>
- C Library - <setjmp.h>
- C Library - <signal.h>
- C Library - <stdarg.h>
- C Library - <stddef.h>
- C Library - <stdio.h>
- C Library - <stdlib.h>
- C Library - <string.h>
- C Library - <time.h>
- C Standard Library Resources
- C Library - Quick Guide
- C Library - Useful Resources
- C Library - Discussion
- C Programming Resources
- C Programming - Tutorial
- C - Useful Resources
C library Macro - EDOM
Description
As mentioned above, the C library macro EDOM represents a domain error, which occurs if an input argument is outside the domain, over which the mathematical function is defined and errno is set to EDOM.
Declaration
Following is the declaration for EDOM Macro.
#define EDOM some_value
Parameters
NA
Return Value
NA
Example
The following example shows the usage of EDOM Macro.
#include <stdio.h> #include <errno.h> #include <math.h> int main () { double val; errno = 0; val = sqrt(-10); if(errno == EDOM) { printf("Invalid value \n"); } else { printf("Valid value\n"); } errno = 0; val = sqrt(10); if(errno == EDOM) { printf("Invalid value\n"); } else { printf("Valid value\n"); } return(0); }
Let us compile and run the above program that will produce the following result −
Invalid value Valid value
errorno_h.htm
Advertisements