You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template log10_tmpl(k)
integer, constant :: k
private
public :: log10
interface log10
procedure log10_local
end interface
contains
simple elemental function log10_local(x) result(r)
real(k), intent(in) :: x
real(k) :: r
r =log(x) /log(10._k)
end function
end template
and you use it like:
use kinds_m, only: wp
instantiate log10_tmpl(wp)
real(wp) :: x, y
x =42._wp
y =log10(x)
The text was updated successfully, but these errors were encountered:
Here is one:
https://fortran-lang.discourse.group/t/can-floating-point-literals-be-adapted-by-the-compiler-to-double-precision-variable/2034/102
and you use it like:
The text was updated successfully, but these errors were encountered: