Debian Codegraph @

doc/src/intrinsics/numeric/conjg.md

raw
1 # conjg(x): Complex Conjugate
2
3 Complex conjugate function.
4
5 ## Declaration
6
7 ### Syntax
8
9 ```fortran
10 retval = conjg(x)
11 function conjgz32(x)
12 function conjgz64(x)
13 ```
14
15 ### Arguments
16
17 `x` the input value must be of type complex.
18
19 ### Return values
20
21 The return value is of complex type.
22
23 ## Description
24
25 **conjg(x)** converts the input value `x` to its conjugate.
26
27 For `x` complex input value, the result is calculated using mathematical formula:
28
29 $x + iy$ converted to $x - iy$
30
31 $i$ the imaginary part is the result.
32
33 ## Types
34
35 Supported argument types is complex.
36
37 ```fortran
38 interface conjg
39 module procedure conjgz32, conjgz64
40 end interface
41
42 contains
43
44 function conjgz32(x)
45 complex(sp) :: x
46 end function
47
48 function conjgz64(x)
49 complex(dp) :: x
50 end function
51 ```
52
53 ## Examples
54
55 ```fortran
56 program intrinsics_conjg
57 implicit none
58 print *, conjg((1.0, -3.0))
59 end program
60 ```
61
62 **Result:**
63
64 ```
65 1 + 3i
66 ```
67
68 ## See Also
69