Numeric routines are available for calculating Bessel functions, data type conversion, and generating random numbers:
Portability Routine | Description |
---|---|
BESJ0, BESJ1, BESJN, BESY0, BESY1, BESYN | Computes the single precision values of Bessel functions of the first and second kind of orders 1, 2, and n, respectively |
DBESJ0, DBESJ1, DBESJN, DBESY0, DBESY1, DBESYN | Computes the double-precision values of Bessel functions of the first and second kind of orders 1, 2, and n, respectively |
LONG | Converts an INTEGER(2) variable to an INTEGER(4) type |
SHORT | Converts an INTEGER(4) variable to an INTEGER(2) type |
IRAND, IRANDM | Returns a positive integer in the range 0 through (2**31)-1, or (2**15)-1 if called without an argument |
RAN | Returns random values in the range 0 through 1.0 |
RAND, DRAND | Returns random values in the range 0 through 1.0 |
DRANDM, RANDOM | Returns random values in the range 0 through 1.0 |
SRAND | Seeds the random number generator used with IRAND and RAND. |
BIC, BIS, BIT | Perform bit level clear, set, and test for integers |
Some of these functions have equivalents in standard Fortran 95/90. Data object conversion can be accomplished by using the INT intrinsic function instead of LONG or SHORT. The intrinsic subroutines RANDOM_NUMBER and RANDOM_SEED perform the same functions as the random number functions listed in the previous table.
Other bit manipulation functions such as AND, XOR, OR, LSHIFT, and RSHIFT are intrinsic functions. You do not need the DFPORT module to access them. Standard Fortran 95/90 includes many bit operation procedures; these are listed in the Bit Operation Procedures table in the Language Reference.