gray/src/math.f90

20 lines
351 B
Fortran
Raw Normal View History

! Miscellaneous mathematical functions
2015-11-18 17:34:33 +01:00
module math
implicit none
2015-11-18 17:34:33 +01:00
contains
pure function fact(k)
! Factorial function k!
! Note: the result is a real number
use const_and_precisions, only : wp_
2015-11-18 17:34:33 +01:00
integer, intent(in) :: k
real(wp_) :: fact
2015-11-18 17:34:33 +01:00
fact = gamma(real(1 + k, kind=wp_))
end function fact
2015-11-18 17:34:33 +01:00
end module math