We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It does, as for positive whole values of X the Gamma function simplifies to the factorial function for (X-1). That is,
x! == gamma(x+1)
program testit use, intrinsic :: iso_fortran_env, only : wp=>real64 integer,parameter :: n(*)=[0,1,5,11,170] integer :: j do j=1,size(n) write(*,'(*(g0,1x))')'factorial of', n(j),' is ', & & product([(real(i,kind=wp),i=1,n(j))]), & & ' or ', & & gamma(real(n(j)+1,kind=wp)) enddo end program testit
The text was updated successfully, but these errors were encountered:
Posted, thanks!
Sorry, something went wrong.
No branches or pull requests
Why does Fortran not have a factorial function?
It does, as for positive whole values of X the Gamma
function simplifies to the factorial function for (X-1).
That is,
The text was updated successfully, but these errors were encountered: