# C Programming/complex.h/cimag

< C Programming | complex.h(Redirected from C Programming/C Reference/complex.h/cimag)## PrototypesEdit

```
double cimag(double complex z);
float cimagf(float complex z);
long double cimagl(long double complex z);
```

## DescriptionEdit

**cimag** is a complex function in c programming. As complex numbers contain two parts, one real part and one imaginary part, this function is used to declare the imaginary part of a complex number. For example, let 'M' be any complex number which can be represented using c functions as follows:

- M = creal(M) + cimag(M) * i
- where creal(M) = real part of M.
- The function returns the imaginary part of the complex no.