73bd010458
Only a single `implicit none` at the start of each module is required.
20 lines
351 B
Fortran
20 lines
351 B
Fortran
! Miscellaneous mathematical functions
|
|
module math
|
|
|
|
implicit none
|
|
|
|
contains
|
|
|
|
pure function fact(k)
|
|
! Factorial function k!
|
|
! Note: the result is a real number
|
|
use const_and_precisions, only : wp_
|
|
|
|
integer, intent(in) :: k
|
|
real(wp_) :: fact
|
|
|
|
fact = gamma(real(1 + k, kind=wp_))
|
|
end function fact
|
|
|
|
end module math
|