| 1 |
'\" t |
| 2 |
.\" Copyright 2002, Walter Harms <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-1.0-or-later |
| 6 |
.\" |
| 7 |
.TH cimag 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
cimag, cimagf, cimagl \- get imaginary part of a complex number |
| 10 |
.SH LIBRARY |
| 11 |
Math library |
| 12 |
.RI ( libm ,\~ \-lm ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <complex.h> |
| 16 |
.P |
| 17 |
.BI "double cimag(double complex " z ); |
| 18 |
.BI "float cimagf(float complex " z ); |
| 19 |
.BI "long double cimagl(long double complex " z ); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
These functions return the imaginary part of the complex number |
| 23 |
.IR z . |
| 24 |
.P |
| 25 |
One has: |
| 26 |
.P |
| 27 |
.in +4n |
| 28 |
.EX |
| 29 |
z = creal(z) + I * cimag(z) |
| 30 |
.EE |
| 31 |
.in |
| 32 |
.SH ATTRIBUTES |
| 33 |
For an explanation of the terms used in this section, see |
| 34 |
.BR attributes (7). |
| 35 |
.TS |
| 36 |
allbox; |
| 37 |
lbx lb lb |
| 38 |
l l l. |
| 39 |
Interface Attribute Value |
| 40 |
T{ |
| 41 |
.na |
| 42 |
.nh |
| 43 |
.BR cimag (), |
| 44 |
.BR cimagf (), |
| 45 |
.BR cimagl () |
| 46 |
T} Thread safety MT-Safe |
| 47 |
.TE |
| 48 |
.SH VERSIONS |
| 49 |
GCC also supports __imag__. |
| 50 |
That is a GNU extension. |
| 51 |
.SH STANDARDS |
| 52 |
C11, POSIX.1-2008. |
| 53 |
.SH HISTORY |
| 54 |
glibc 2.1. |
| 55 |
C99, POSIX.1-2001. |
| 56 |
.SH SEE ALSO |
| 57 |
.BR cabs (3), |
| 58 |
.BR creal (3), |
| 59 |
.BR complex (7) |