3 ! Test the vendor intrinsic (d)gamma, lgamma and algama/dlgama
4 ! gamma is also part of the Fortran 2008 draft; lgamma is called
5 ! log_gamma in the Fortran 2008 draft.
11 intrinsic :: gamma
, lgamma
, log_gamma
12 integer, parameter :: sp
= kind(1.0)
13 integer, parameter :: dp
= kind(1.0d0)
18 if (abs(gamma(1.0_sp
) - 1.0_sp
) > tiny(1.0_sp
)) call abort()
19 if (abs(gamma(1.0_dp
) - 1.0_dp
) > tiny(1.0_dp
)) call abort()
20 if (abs(dgamma(1.0_dp
) - 1.0_dp
) > tiny(1.0_dp
)) call abort()
22 if (abs(lgamma(1.0_sp
)) > tiny(1.0_sp
)) call abort()
23 if (abs(lgamma(1.0_dp
)) > tiny(1.0_dp
)) call abort()
24 if (abs(log_gamma(1.0_sp
)) > tiny(1.0_sp
)) call abort()
25 if (abs(log_gamma(1.0_dp
)) > tiny(1.0_dp
)) call abort()
26 if (abs(algama(1.0_sp
)) > tiny(1.0_sp
)) call abort()
27 if (abs(dlgama(1.0_dp
)) > tiny(1.0_dp
)) call abort()
28 end program gamma_test