Compiler Library/XL Reference Manual (32650-90029)

2- 24
number the sign of the second shortint number.
Declaration
FUNCTION ISIGN(j,k:SHORTINT):SHORTINT; EXTERNAL;
Attributes
Parameters: Both arguments are shortint numbers; if the
second number is zero, the sign is assumed to
be positive.
Result: An integer number.
HP FORTRAN 77/XL: Intrinsic function: L=ISIGN(J,K)
Error: None.
JSIGN (or JSIGN')
JSIGN calculates the absolute value of the first integer number and gives
the number the sign of the second integer number.
Declaration
FUNCTION JSIGN(j,k:INTEGER):INTEGER; EXTERNAL;
Attributes
Parameters: Both arguments are integer numbers; if the
second number is zero, the sign is assumed to
be positive.
Result: An integer number.
HP FORTRAN 77/XL: Intrinsic function: L=JSIGN(J,K).
Error: None.
RAND (or RAND')
RAND generates the next element of a sequence of pseudo-random numbers.
Declaration
FUNCTION RAND(VAR x:INTEGER):REAL; EXTERNAL;
Attributes
Parameter: A integer number.
Results: A representable real number uniformly
distributed in the range (0.0, 1.0) returned as
the value of the routine, and a 32-bit quantity
replacing the original value of the parameter.
See Chapter 1 for details on the internal
representation of real numbers.
HP FORTRAN 77/XL: Callable as a system intrinsic: Y = RAND(I)
Comments
The parameter value for the initial call to RAND completely determines a
sequence of pseudo-random numbers. Each time RAND returns a new value to
the calling program, it also sets a new 32-bit value in place of the
parameter. To continue the pseudo-random sequence thus initiated, that
32-bit value must be used as the parameter in the next call to RAND.