Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29228 ディスカッション

Why we need a double precision functions?

if001
ビギナー
2,763件の閲覧回数
For example, there is a same result

REAL(8) :: log_double = 5.D0
PRINT*,"LOG ( DOUBLE ) =", LOG(log_double)
PRINT*,"DLOG( DOUBLE ) =", DLOG(log_double)



LOG ( DOUBLE ) = 1.60943791243410
DLOG( DOUBLE ) = 1.60943791243410
Thanks for answers,

Pete.
0 件の賞賛
6 返答(返信)
mecej4
名誉コントリビューター III
2,763件の閲覧回数
In Fortran 77 and earlier, there was ALOG for single precision arguments and DLOG for double precision arguments. Fortran 90 introduced the generic function LOG to make it easier to write code without having to remember the specific names of all the intrinsic functions. LOG() is equivalent to ALOG and LOG() is equivalent to DLOG.

The specific names are still retained for the sake of backwards compatibility.
if001
ビギナー
2,763件の閲覧回数
Thank you. I hope that a same way was made for SIN, COS and etc.....
TimP
名誉コントリビューター III
2,763件の閲覧回数
All of the intrinsic functions mentioned in this thread were made generic in the f77 standard, making the f66 double precision versions de facto obsolescent. Internally, the support library may have separate entry points for various data types (not to mention scalar vs. vector, and for various instruction sets and, in ifort 12, arch-compatibility vs. specific sub-architectures), all accessed via the standard intrinsic names.
if001
ビギナー
2,763件の閲覧回数
Oh, the last stuppid question please!
About entry points.
Will be my prog run "faster" if old fashion DSIN(double) vs SIN(double)is using?
Steven_L_Intel1
従業員
2,763件の閲覧回数
No. Exactly the same run-time code is used in either case. However, use of specific functions such as DSIN can cause maintenance problems later so I recommend using the generic functions where possible.
if001
ビギナー
2,763件の閲覧回数
Thank you Steve,

This is sad news for all my previuos program code. :)
DEC is in our hearts. ;)

返信