1 | ! ifort17 -o test_spdp.exe test_spdp.f90
|
---|
2 |
|
---|
3 | program test_spdp
|
---|
4 |
|
---|
5 | integer, parameter :: sp=KIND(1.0), dp=KIND(1.d0)
|
---|
6 | integer, parameter :: wp=sp
|
---|
7 | !integer, parameter :: wp=dp
|
---|
8 | real(sp) :: x4
|
---|
9 | real(dp) :: x8
|
---|
10 |
|
---|
11 | real(wp) :: freq
|
---|
12 |
|
---|
13 | print*,'sp, dp, wp = ', sp, dp, wp
|
---|
14 |
|
---|
15 | freq = 1575420000_wp
|
---|
16 | write(*,'(A,E20.10)')' 1575420000_wp = ', freq
|
---|
17 |
|
---|
18 | freq = 1.57542E9_wp
|
---|
19 | write(*,'(A,E20.10)')' 1.57542E9_wp = ', freq
|
---|
20 |
|
---|
21 |
|
---|
22 | x4 = 1575420000_sp
|
---|
23 | write(*,'(A,E20.10)')' x4 = ', x4
|
---|
24 | write(*,'(A,I20)')' 1575420000_sp = ', 1575420000_sp
|
---|
25 | write(*,'(A,E20.10)')' 1575420000.0_sp = ', 1575420000.0_sp
|
---|
26 | !write(10) -1.5_sp
|
---|
27 | !write(10) 1.57542E9_sp
|
---|
28 | write(10) 1575420000.0_sp
|
---|
29 |
|
---|
30 | x8 = 1575420000_dp
|
---|
31 | write(*,'(A,E20.10)')' x8 = ', x8
|
---|
32 | write(*,'(A,I20)')' 1575420000_dp = ', 1575420000_dp
|
---|
33 | write(*,'(A,E20.10)')' 1575420000.0_dp = ', 1575420000.0_dp
|
---|
34 | !write(11) -1.5_dp
|
---|
35 | !write(11) 1.57542E9_dp
|
---|
36 | write(11) 1575420000.0_dp
|
---|
37 |
|
---|
38 |
|
---|
39 | end program test_spdp
|
---|