log in Fortran Wiki
## Description `log(x)` computes the natural logarithm of `x`, i.e. the logarithm to the base $e$. ## Standard [[FORTRAN 77]] and later ## Class [[Elemental procedure|Elemental function]] ## Syntax ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {: lang=fortran } result = log(x) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Arguments - `x` - The type shall be `real` or `complex`. ## Return value The return value is of type `real` or `complex`. The kind type parameter is the same as `x`. If `x` is `complex`, the imaginary part $\omega$ is in the range $-\pi \lt \omega \leq \pi$. ## Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {: lang=fortran } program test_log real :: x = 2.7182818284590451_8 complex :: z = (1.0, 2.0) x = log(x) ! will yield (approximately) 1 z = log(z) end program test_log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ category: intrinsics
AltStyle
によって変換されたページ
(->オリジナル)
/
アドレス:
モード:
デフォルト
音声ブラウザ
ルビ付き
配色反転
文字拡大
モバイル