Skip to content
New issue

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

fix(factorial): result should be of the default kind, not double default kind #876

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/stdlib_specialfunctions_gamma.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ contains
! Log(n!)
!
${t1}$, intent(in) :: n
real :: res
real(dp) :: res
${t1}$, parameter :: zero = 0_${k1}$, one = 1_${k1}$, two = 2_${k1}$
real, parameter :: zero_k2 = 0.0
real(dp), parameter :: zero_dp = 0.0_dp

if(n < zero) call error_stop("Error(l_factorial): Logarithm of" &
//" factorial function argument must be non-negative")
Expand All @@ -539,15 +539,15 @@ contains

case (zero)

res = zero_k2
res = zero_dp

case (one)

res = zero_k2
res = zero_dp

case (two : )

res = l_gamma(n + 1, 1.0D0)
res = l_gamma(n + 1, 1.0_dp)

end select
end function l_factorial_${t1[0]}$${k1}$
Expand Down
Loading