[Fortran] 纯文本查看 复制代码
function r8_log_10 ( x )
!c*********************************************************************72
!c
!cc R8_LOG_10 returns the logarithm base 10 of an R8.
!c
!c Discussion:
!c
!c value = Log10 ( |X| )
!c
!c Parameters:
!c
!c Input, double precision X, the number whose base 2 logarithm is desired.
!c X should not be 0.
!c
!c Output, double precision R8_LOG_10, the logarithm base 10 of the absolute
!c value of X. It should be true that |X| = 10**R_LOG_10.
!c
implicit none
double precision r8_huge
double precision r8_log_10
double precision x
if ( x .eq. 0.0D+00 ) then
#7492 | r8_log_10 = - r8_huge ( x )
else
r8_log_10 = log10 ( abs ( x ) )
end if
return
end
********************************