chap03/kadai3.f90
1program answer
2 implicit none
3
4 real(4) :: pi4
5 real(8) :: pi8
6 real(16) :: pi16
7
8 pi4 = atan(1.0_4) * 4.0_4
9 pi8 = atan(1.0_8) * 4.0_8
10 pi16 = atan(1.0_16) * 4.0_16
11
12 write(*, *) real(pi4, 16), abs(1 - pi4 / pi16)
13 write(*, *) real(pi8, 16), abs(1 - pi8 / pi16)
14 write(*, *) real(pi16, 16)
15
16 stop
17endprogram answer