]>
Commit | Line | Data |
---|---|---|
b811d2c2 | 1 | ! Copyright 2007-2020 Free Software Foundation, Inc. |
1db455a7 AB |
2 | ! |
3 | ! This program is free software; you can redistribute it and/or modify | |
4 | ! it under the terms of the GNU General Public License as published by | |
5 | ! the Free Software Foundation; either version 3 of the License, or | |
6 | ! (at your option) any later version. | |
7 | ! | |
8 | ! This program is distributed in the hope that it will be useful, | |
9 | ! but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | ! GNU General Public License for more details. | |
12 | ! | |
13 | ! You should have received a copy of the GNU General Public License | |
14 | ! along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | ||
16 | program test_complex | |
17 | real*4 r4a, r4b | |
18 | real*8 r8a, r8b | |
19 | real*16 r16a, r16b | |
20 | ||
21 | complex c | |
22 | complex(kind=4) c4 | |
23 | complex(kind=8) c8 | |
24 | double complex dc | |
25 | complex(kind=16) c16 | |
26 | ||
27 | r4a = 1000 | |
28 | r4b = -50 | |
29 | r8a = 321 | |
30 | r8b = -22 | |
31 | r16a = -874 | |
32 | r16b = 19 | |
33 | ||
34 | c = cmplx(r4a,r4b) | |
35 | c4 = cmplx(r4a,r4b) | |
36 | c8 = cmplx(r8a, r8b) | |
37 | dc = cmplx(r8a, r8b) | |
38 | c16 = cmplx(r16a, r16b) | |
39 | ||
40 | print *, c, c4, c8, dc, c16 ! stop | |
41 | print *, r4a, r4b | |
42 | print *, r8a, r8b | |
43 | print *, r16a, r16b | |
44 | end program test_complex |