📄 intdoc.in
字号:
@xref{IBClr Intrinsic}, for how to set a bit in a variable to 0.")DEFDOC (BTEST, "Test bit.", "\Returns @code{.TRUE.} if bit @var{@2@} in @var{@1@} is1, @code{.FALSE.} otherwise.(Bit 0 is the low-order (rightmost) bit, adding the value @ifinfo2**0,@end ifinfo@iftex@tex$2^0$,@end tex@end iftexor 1,to the number if set to 1;bit 1 is the next-higher-order bit, adding @ifinfo2**1,@end ifinfo@iftex@tex$2^1$,@end tex@end iftexor 2;bit 2 adds @ifinfo2**2,@end ifinfo@iftex@tex$2^2$,@end tex@end iftexor 4; and so on.)@xref{Bit_Size Intrinsic}, for how to obtain the number of bitsin a type.The leftmost bit of @var{@1@} is @samp{BIT_SIZE(@var{@1@}-1)}.")DEFDOC (CMPLX, "Construct @code{COMPLEX(KIND=1)} value.", "\If @var{@1@} is not type @code{COMPLEX},constructs a value of type @code{COMPLEX(KIND=1)} from thereal and imaginary values specified by @var{@1@} and@var{@2@}, respectively.If @var{@2@} is omitted, @samp{0.} is assumed.If @var{@1@} is type @code{COMPLEX},converts it to type @code{COMPLEX(KIND=1)}.@xref{Complex Intrinsic}, for information on easily constructinga @code{COMPLEX} value of arbitrary precision from @code{REAL}arguments.")DEFDOC (DCMPLX, "Construct @code{COMPLEX(KIND=2)} value.", "\If @var{@1@} is not type @code{COMPLEX},constructs a value of type @code{COMPLEX(KIND=2)} from thereal and imaginary values specified by @var{@1@} and@var{@2@}, respectively.If @var{@2@} is omitted, @samp{0D0} is assumed.If @var{@1@} is type @code{COMPLEX},converts it to type @code{COMPLEX(KIND=2)}.Although this intrinsic is not standard Fortran,it is a popular extension offered by many compilersthat support @code{DOUBLE COMPLEX}, since it offersthe easiest way to convert to @code{DOUBLE COMPLEX}without using Fortran 90 features (such as the @samp{KIND=}argument to the @code{CMPLX()} intrinsic).(@samp{CMPLX(0D0, 0D0)} returns a single-precision@code{COMPLEX} result, as required by standard FORTRAN 77.That's why so many compilers provide @code{DCMPLX()}, since@samp{DCMPLX(0D0, 0D0)} returns a @code{DOUBLE COMPLEX}result.Still, @code{DCMPLX()} converts even @code{REAL*16} argumentsto their @code{REAL*8} equivalents in most dialects ofFortran, so neither it nor @code{CMPLX()} allow easyconstruction of arbitrary-precision values withoutpotentially forcing a conversion involving extending orreducing precision.GNU Fortran provides such an intrinsic, called @code{COMPLEX()}.)@xref{Complex Intrinsic}, for information on easily constructinga @code{COMPLEX} value of arbitrary precision from @code{REAL}arguments.")DEFDOC (CONJG, "Complex conjugate.", "\Returns the complex conjugate:@exampleCOMPLEX(REALPART(@var{@1@}), -IMAGPART(@var{@1@}))@end example")DEFDOC (DCONJG, "Complex conjugate (archaic).", ARCHAIC (CONJG, Conjg))DEFDOC (COS, "Cosine.", "\Returns the cosine of @var{@1@}, an angle measuredin radians.@xref{ACos Intrinsic}, for the inverse of this function.")DEFDOC (CCOS, "Cosine (archaic).", ARCHAIC (COS, Cos))DEFDOC (DCOS, "Cosine (archaic).", ARCHAIC (COS, Cos))DEFDOC (CDCOS, "Cosine (archaic).", ARCHAIC (COS, Cos))DEFDOC (COSH, "Hyperbolic cosine.", "\Returns the hyperbolic cosine of @var{@1@}.")DEFDOC (DCOSH, "Hyperbolic cosine (archaic).", ARCHAIC (COSH, CosH))DEFDOC (SQRT, "Square root.", "\Returns the square root of @var{@1@}, which mustnot be negative.To calculate and represent the square root of a negativenumber, complex arithmetic must be used.For example, @samp{SQRT(COMPLEX(@var{@1@}))}.The inverse of this function is @samp{SQRT(@var{@1@}) * SQRT(@var{@1@})}.")DEFDOC (CSQRT, "Square root (archaic).", ARCHAIC (SQRT, SqRt))DEFDOC (DSQRT, "Square root (archaic).", ARCHAIC (SQRT, SqRt))DEFDOC (CDSQRT, "Square root (archaic).", ARCHAIC (SQRT, SqRt))DEFDOC (DBLE, "Convert to double precision.", "\Returns @var{@1@} converted to double precision(@code{REAL(KIND=2)}).If @var{@1@} is @code{COMPLEX}, the real part of@var{@1@} is used for the conversionand the imaginary part disregarded.@xref{Sngl Intrinsic}, for the function that convertsto single precision.@xref{Int Intrinsic}, for the function that convertsto @code{INTEGER}.@xref{Complex Intrinsic}, for the function that convertsto @code{COMPLEX}.")DEFDOC (DIM, "Difference magnitude (non-negative subtract).", "\Returns @samp{@var{@1@}-@var{@2@}} if @var{@1@} is greater than@var{@2@}; otherwise returns zero.")DEFDOC (DDIM, "Difference magnitude (archaic).", ARCHAIC_2 (DIM, DiM))DEFDOC (IDIM, "Difference magnitude (archaic).", ARCHAIC_2 (DIM, DiM))DEFDOC (DPROD, "Double-precision product.", "\Returns @samp{DBLE(@var{@1@})*DBLE(@var{@2@})}.")DEFDOC (EXP, "Exponential.", "\Returns @samp{@var{e}**@var{@1@}}, where@var{e} is approximately 2.7182818.@xref{Log Intrinsic}, for the inverse of this function.")DEFDOC (CEXP, "Exponential (archaic).", ARCHAIC (EXP, Exp))DEFDOC (DEXP, "Exponential (archaic).", ARCHAIC (EXP, Exp))DEFDOC (CDEXP, "Exponential (archaic).", ARCHAIC (EXP, Exp))DEFDOC (FLOAT, "Conversion (archaic).", ARCHAIC (REAL, Real))DEFDOC (DFLOAT, "Conversion (archaic).", ARCHAIC (REAL, Real))DEFDOC (IFIX, "Conversion (archaic).", ARCHAIC (INT, Int))DEFDOC (LONG, "Conversion to @code{INTEGER(KIND=1)} (archaic).", "\Archaic form of @code{INT()} that is specificto one type for @var{@1@}.@xref{Int Intrinsic}.The precise meaning of this intrinsic might changein a future version of the GNU Fortran language,as more is learned about how it is used.")DEFDOC (SHORT, "Convert to @code{INTEGER(KIND=6)} value@99@truncated to whole number.", "\Returns @var{@1@} with the fractional portion of itsmagnitude truncated and its sign preserved, convertedto type @code{INTEGER(KIND=6)}.If @var{@1@} is type @code{COMPLEX}, its real partis truncated and converted, and its imaginary part is disgregarded.@xref{Int Intrinsic}.The precise meaning of this intrinsic might changein a future version of the GNU Fortran language,as more is learned about how it is used.")DEFDOC (INT2, "Convert to @code{INTEGER(KIND=6)} value@99@truncated to whole number.", "\Returns @var{@1@} with the fractional portion of itsmagnitude truncated and its sign preserved, convertedto type @code{INTEGER(KIND=6)}.If @var{@1@} is type @code{COMPLEX}, its real partis truncated and converted, and its imaginary part is disgregarded.@xref{Int Intrinsic}.The precise meaning of this intrinsic might changein a future version of the GNU Fortran language,as more is learned about how it is used.")DEFDOC (INT8, "Convert to @code{INTEGER(KIND=2)} value@99@truncated to whole number.", "\Returns @var{@1@} with the fractional portion of itsmagnitude truncated and its sign preserved, convertedto type @code{INTEGER(KIND=2)}.If @var{@1@} is type @code{COMPLEX}, its real partis truncated and converted, and its imaginary part is disgregarded.@xref{Int Intrinsic}.The precise meaning of this intrinsic might changein a future version of the GNU Fortran language,as more is learned about how it is used.")DEFDOC (LEN, "Length of character entity.", "\Returns the length of @var{@1@}.If @var{@1@} is an array, the length of an elementof @var{@1@} is returned.Note that @var{@1@} need not be defined when thisintrinsic is invoked, since only the length, notthe content, of @var{@1@} is needed.@xref{Bit_Size Intrinsic}, for the function that determinesthe size of its argument in bits.")DEFDOC (TAN, "Tangent.", "\Returns the tangent of @var{@1@}, an angle measuredin radians.@xref{ATan Intrinsic}, for the inverse of this function.")DEFDOC (DTAN, "Tangent (archaic).", ARCHAIC (TAN, Tan))DEFDOC (TANH, "Hyperbolic tangent.", "\Returns the hyperbolic tangent of @var{@1@}.")DEFDOC (DTANH, "Hyperbolic tangent (archaic).", ARCHAIC (TANH, TanH))DEFDOC (SNGL, "Convert (archaic).", ARCHAIC (REAL, Real))DEFDOC (SIN, "Sine.", "\Returns the sine of @var{@1@}, an angle measuredin radians.@xref{ASin Intrinsic}, for the inverse of this function.")DEFDOC (CSIN, "Sine (archaic).", ARCHAIC (SIN, Sin))DEFDOC (DSIN, "Sine (archaic).", ARCHAIC (SIN, Sin))DEFDOC (CDSIN, "Sine (archaic).", ARCHAIC (SIN, Sin))DEFDOC (SINH, "Hyperbolic sine.", "\Returns the hyperbolic sine of @var{@1@}.")DEFDOC (DSINH, "Hyperbolic sine (archaic).", ARCHAIC (SINH, SinH))DEFDOC (LSHIFT, "Left-shift bits.", "\Returns @var{@1@} shifted to the left@var{@2@} bits.Although similar to the expression@samp{@var{@1@}*(2**@var{@2@})}, thereare important differences.For example, the sign of the result isnot necessarily the same as the sign of@var{@1@}.Currently this intrinsic is defined assumingthe underlying representation of @var{@1@}is as a two's-complement integer.It is unclear at this point whether thatdefinition will apply when a differentrepresentation is involved.@xref{LShift Intrinsic}, for the inverse of this function.@xref{IShft Intrinsic}, for informationon a more widely available left-shiftingintrinsic that is also more precisely defined.")DEFDOC (RSHIFT, "Right-shift bits.", "\Returns @var{@1@} shifted to the right@var{@2@} bits.Although similar to the expression@samp{@var{@1@}/(2**@var{@2@})}, thereare important differences.For example, the sign of the result isundefined.Currently this intrinsic is defined assumingthe underlying representation of @var{@1@}is as a two's-complement integer.It is unclear at this point whether thatdefinition will apply when a differentrepresentation is involved.@xref{RShift Intrinsic}, for the inverse of this function.@xref{IShft Intrinsic}, for informationon a more widely available right-shiftingintrinsic that is also more precisely defined.")DEFDOC (LGE, "Lexically greater than or equal.", "\Returns @samp{.TRUE.} if @samp{@var{@1@}.GE.@var{@2@}},@samp{.FALSE.} otherwise.@var{@1@} and @var{@2@} are interpreted as containingASCII character codes.If either value contains a character not in the ASCIIcharacter set, the result is processor dependent.If the @var{@1@} and @var{@2@} are not the same length,the shorter is compared as if spaces were appended toit to form a value that has the same length as the longer.The lexical comparison intrinsics @code{LGe}, @code{LGt},@code{LLe}, and @code{LLt} differ from the correspondingintrinsic operators @code{.GE.}, @code{.GT.},@code{.LE.}, @code{.LT.}.Because the ASCII collating sequence is assumed,the following expressions always return @samp{.TRUE.}:@smallexampleLGE ('0', ' ')LGE ('A', '0')LGE ('a', 'A')@end smallexampleThe following related expressions do @emph{not} alwaysreturn @samp{.TRUE.}, as they are not necessarily evaluatedassuming the arguments use ASCII encoding:@smallexample'0' .GE. ' ''A' .GE. '0''a' .GE. 'A'@end smallexampleThe same difference existsbetween @code{LGt} and @code{.GT.};between @code{LLe} and @code{.LE.}; andbetween @code{LLt} and @code{.LT.}.")DEFDOC (LGT, "Lexically greater than.", "\Returns @samp{.TRUE.} if @samp{@var{@1@}.GT.@var{@2@}},@samp{.FALSE.} otherwise.@var{@1@} and @var{@2@} are interpreted as containingASCII character codes.If either value contains a character not in the ASCIIcharacter set, the result is processor dependent.If the @var{@1@} and @var{@2@} are not the same length,the shorter is compared as if spaces were appended toit to form a value that has the same length as the longer.@xref{LGe Intrinsic}, for information on the distinctionbetween the @code{@0@} intrinsic and the @code{.GT.}operator.")DEFDOC (LLE, "Lexically less than or equal.", "\Returns @samp{.TRUE.} if @samp{@var{@1@}.LE.@var{@2@}},@samp{.FALSE.} otherwise.@var{@1@} and @var{@2@} are interpreted as containingASCII character codes.If either value contains a character not in the ASCIIcharacter set, the result is processor dependent.If the @var{@1@} and @var{@2@} are not the same length,the shorter is compared as if spaces were appended toit to form a value that has the same length as the longer.@xref{LGe Intrinsic}, for information on the distinctionbetween the @code{@0@} intrinsic and the @code{.LE.}operator.")DEFDOC (LLT, "Lexically less than.", "\Returns @samp{.TRUE.} if @samp{@var{@1@}.LT.@var{@2@}},@samp{.FALSE.} otherwise.@var{@1@} and @var{@2@} are interpreted as containingASCII character codes.If either value contains a character not in the ASCIIcharacter set, the result is processor dependent.If the @var{@1@} and @var{@2@} are not the same length,the shorter is compared as if spaces were appended toit to form a value that has the same length as the longer.@xref{LGe Intrinsic}, for information on the distinctionbetween the @code{@0@} intrinsic and the @code{.LT.}operator.")DEFDOC (SIGN, "Apply sign to magnitude.", "\Returns @samp{ABS(@var{@1@})*@var{s}}, where@var{s} is +1 if @samp{@var{@2@}.GE.0},-1 otherwise.@xref{Abs Intrinsic}, for the function that returnsthe magnitude of a value.")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -