2023-02-26 01:10
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
BIN
hello/hello
Executable file
BIN
hello/hello
Executable file
Binary file not shown.
18
hello/hello.f90
Normal file
18
hello/hello.f90
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
program variables
|
||||||
|
use, intrinsic :: iso_fortran_env, only: sp=>real32, dp=>real64
|
||||||
|
! use, intrinsic :: iso_c_binding, only: sp=>c_float, dp=>c_double
|
||||||
|
implicit none
|
||||||
|
|
||||||
|
real :: val0
|
||||||
|
real(sp) :: val1 ! 단정도
|
||||||
|
real(dp) :: val2 ! 배정도
|
||||||
|
|
||||||
|
val0 = 0.
|
||||||
|
val1 = 0._sp
|
||||||
|
val2 = 0._dp
|
||||||
|
|
||||||
|
print *, 'Max = ', huge(val0)
|
||||||
|
print *, 'Max32 = ', huge(val1)
|
||||||
|
print *, 'Max64 = ', huge(val2)
|
||||||
|
|
||||||
|
end program variables
|
||||||
BIN
hello/stdio
Executable file
BIN
hello/stdio
Executable file
Binary file not shown.
6
hello/stdio.f90
Normal file
6
hello/stdio.f90
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
program stdio
|
||||||
|
implicit none
|
||||||
|
character(len=16) :: name
|
||||||
|
read (*,*) name
|
||||||
|
print *, 'Hello, ', name
|
||||||
|
end program stdio
|
||||||
Reference in New Issue
Block a user