FORTRAN Reference Manual

Intrinsic Functions
FORTRAN Reference Manual528615-001
8-10
CHAR Function
CHAR Function
The CHAR function returns the character value of a specified position in the ASCII
collating sequence.
n
is an integer expression with a value from 0 through 127.
Considerations
The CHAR function result is always type character*1.
The value of CHAR (n) is undefined for argument values of
n 0 or n > 127
The CHAR function is the inverse of the ICHAR function.
The ASCII collating sequence is given in Appendix A, ASCII Character Set.
Examples of the CHAR Function
The following example returns a value of “Z” for LETTER and a value of “#” for SIGN:
CHARACTER letter, sign
letter = CHAR (90)
sign = CHAR (35)
CMPLX Function
The CMPLX function returns the complex value of any numeric type.
x
is an expression of integer, real, double precision, or complex type. See
Considerations.
y
is an expression of integer, real, or double precision type.
CHAR ( n )
CMPLX
x()
xy,()

