HP 3000 Manuals

Function Descriptions (cont.) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

Function Descriptions (cont.) 

INT Function 

INT(arg) is a generic function that converts data types to INTEGER*4.
The argument can be INTEGER*4, REAL*4, REAL*8, REAL*16, or COMPLEX*8; the
result is INTEGER*4.  If arg2 exceeds the largest integer allowed, the
result is undefined.

If arg is an INTEGER*4, INT(arg) = arg.  If arg is REAL*4, REAL*8, or
REAL*16 and arg is less than one, the result is zero.  If arg is greater
than one, the result of INT (arg) is the INTEGER*4 with the same sign as
arg whose magnitude does not exceed arg.  If arg is COMPLEX*8, the real
part of arg is used and the result is found by applying the rules to the
real part of arg.

Examples 

-------------------------------------------------------------------
|                                |                                |
|         Function Call          |      Value Returned to i       |
|                                |                                |
-------------------------------------------------------------------
|                                |                                |
| i = INT(-3.7)                  | -3                             |
|                                |                                |
| i = INT(25)                    | 25                             |
|                                |                                |
| i = INT(25.9D0)                | 25                             |
|                                |                                |
| i = INT(var)                   | 30, where var = (30.57, 0.0)   |
|                                |                                |
-------------------------------------------------------------------

The specific function names are IINT, JINT, IFIX, and JIFIX for REAL*4
arguments, IIDINT and JIDINT for REAL*8 arguments, and IIQINT and JIQINT
for REAL*16 arguments.  IDINT can be used as a generic for REAL*8
arguments.  IQINT can be used as a generic forREAL*16 arguments.  IDINT
can be used as a generic for REAL*8 arguments.  IQINT can be used as a
generic for REAL*16 arguments.  INT, IQINT, IFIX, and IDINT behave
differently when either NOSTANDARD INTRINSICS or HP9000_300 is on.  See
chapter 7 for more information.

INUM Function 

INUM(arg) is a specific function that returns the INTEGER*2 value
represented in the character string arg.

Blanks are not significant in the input string.

Examples 

-------------------------------------------------------------------
|                                |                                |
|         Function Call          |      Value Returned to i2      |
|                                |                                |
-------------------------------------------------------------------
|                                |                                |
| i2 = INUM('123')               | 123                            |
|                                |                                |
| i2 = INUM('-99')               | -99                            |
|                                |                                |
| i2 = INUM('32767')             | 32767                          |
|                                |                                |
| i2 = INUM('   24  ')           | 24 (blanks are ignored)        |
|                                |                                |
-------------------------------------------------------------------

There is no generic name for this function

IOR Function 

IOR(arg1,arg2) is a generic function that returns the logical (bitwise)
sum (Boolean OR) of two INTEGER*4 arguments.  The result is INTEGER*4.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = IOR(1, 1)             | 1                         |
|                           |                           |
| i = IOR(0, 0)             | 0                         |
|                           |                           |
| i = IOR(1, 0)             | 1                         |
|                           |                           |
---------------------------------------------------------

The specific function names are IOR and JIOR for INTEGER*4 arguments and
HIOR and IIOR for INTEGER*2 arguments.

ISHFT Function 

ISHFT(arg1,arg2) is a generic function that returns the value of arg1 
shifted by arg2 bit positions.  If arg2 is greater than zero, the shift
is to the left; if arg2 is less than zero, the shift is to the right; if
arg2 equal zero, no shift occurs.

If arg is an INTEGER*2 argument and arg2 is greater than 15 or arg2 is
less than -15, the result is zero.  If arg2 is an INTEGER*4 and arg2 is
greater than 31 or arg2 is less than -31, the result is zero.

Bits shifted out from the left or right end are lost.  Zeros are shifted
in from the opposite end.  The result is the same type as the arguments.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to a    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| a = ISHFT(3, 4)           | 48                        |
|                           |                           |
| a = ISHFT(1, 4)           | 16                        |
|                           |                           |
| a = ISHFT(1, -4)          | 0                         |
|                           |                           |
---------------------------------------------------------

The specific function names are ISHFT and JISHFT for INTEGER*4 arguments
and HSHFT and IISHFT for INTEGER*2 arguments.

ISHFTC Function 

ISHFTC(arg1, arg2, arg3) is a generic function that returns the circular
shift of an INTEGER*4 argument.  The result is the rightmost a arg3 bits
of arg1 shifted circularly arg2 places.  That is, the bits shifted out of
one end are shifted into the opposite end.  No bits are lost.

The unshifted bits of the result are the same as the unshifted bits of
the argument arg1.  The absolute value of the argument arg2 must be less
than or equal to arg3.  The argument arg3 must be greater than or equal
to one and less than or equal to 16 if arg1 is INTEGER*2, or must be less
than or equal to 32 if arg1 is INTEGER*4.  If arg3 does not fall within
this range, the results can be undefined.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = ISHFTC(3, 4, 8)       | 48                        |
|                           |                           |
| i = ISHFTC(1, 4, 8)       | 16                        |
|                           |                           |
---------------------------------------------------------

The specific function names are ISHFTC and JISHFTC for INTEGER*4
arguments and HSHFTC and IISHFTC for INTEGER*2 arguments.

IXOR Function 

IXOR(arg1,arg2) is a generic function that returns the bitwise exclusive
OR of two INTEGER*4 arguments.  The result is INTEGER*4.

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = IXOR(1, 0)            | 1                         |
|                           |                           |
| i = IXOR(1, 1)            | 0                         |
|                           |                           |
| i = IXOR(0, 0)            | 0                         |
|                           |                           |
---------------------------------------------------------

The alternate generic function name is IEOR. The specific function names
are IEOR and JIXOR for INTEGER*4 arguments and HIEOR and IIXOR for
INTEGER*2 arguments.

IZEXT 

IZEXT(arg) is a generic function that returns a fixed-point argument of
type INTEGER*2 without extending the sign bit of the argument.

In the following example, i2 is an INTEGER*2 variable and L1 is a
LOGICAL*1 variable.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |   Value Returned to i2    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i2 = IZEXT(-L1)           | -1                        |
|                           |                           |
| i2 = IZEXT(L1)            | 255, where L1 = -1        |
|                           |                           |
---------------------------------------------------------

JNUM Function 

JNUM(arg) is a specific function that returns the INTEGER*4 value
represented in the character string arg.

Blanks are not significant in the input string.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = JNUM('123')           | 123                       |
|                           |                           |
| i = JNUM('-99')           | -99                       |
|                           |                           |
| i = JNUM('2000000000')    | 2000000000                |
|                           |                           |
| i = JNUM('    24  ')      | 24 (blanks are ignored)   |
|                           |                           |
---------------------------------------------------------

There is no generic name for this function.

LEN Function 

LEN(arg) is a specific function that returns the length of a character
string.  The argument is type character and the result is an INTEGER*4
indicating the length of the argument.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = LEN('string')         | 6                         |
|                           |                           |
| i = LEN('howlongami')     | 10                        |
|                           |                           |
---------------------------------------------------------

There is no generic name for this function.

LGE Function 

LGE(arg1, arg2) is a specific function that returns a logical result
indicating whether arg1 is lexically greater than or equal to arg2.  The
arguments are character strings.  The result is true if arg1 is equal to
arg2 or if arg1 follows arg2 in the ASCII collating sequence.  In all
other cases, the result is false.  If arg1 and arg2 have unequal lengths
the shorter operand is treated as if padded on the right with blanks to
the length of the longer operand.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = LGE('ABC', 'BC')      | F                         |
|                           |                           |
| i = LGE('BC', 'ABC')      | T                         |
|                           |                           |
| i = LGE('ABC', 'ABC')     | T                         |
|                           |                           |
---------------------------------------------------------

There is no generic name for this function.

LGT Function 

LGT(arg1,arg2) is a specific function that returns a logical result
indicating whether arg1 is lexically greater than arg2.  The arguments
are character strings.  The result is true if arg1 follows arg2 in the
ASCII collating sequence.  In all other cases, the result is false.  If
arg1 and arg2 have unequal lengths, the shorter operand is treated as if
padded on the right with blanks to the length of the longer operand.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = LGT('ABC', 'BC')      | F                         |
|                           |                           |

| i = LGT('BC', 'ABC')      | T                         |
|                           |                           |
| i = LGT('ABC', 'ABC')     | F                         |
|                           |                           |
---------------------------------------------------------

There is no generic name for this function.

LLE Function 

LLE(arg1, arg2) is a specific function that returns a logical result
indicating whether arg1 is lexically less than or equal to arg2.  The
arguments are character strings.  The result is true if arg1 is equal to
arg2 or if arg1 precedes arg2 in the ASCII collating sequence.  In all
other cases, the result is false.  If arg1 and arg2 have unequal lengths,
the shorter operand is treated as if padded on the right with blanks to
the length of the longer operand.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = LLE('ABC', 'BC')      | T                         |
|                           |                           |
| i = LLE('BC', 'ABC')      | F                         |
|                           |                           |
| i = LLE('ABC', 'ABC')     | T                         |
|                           |                           |
---------------------------------------------------------

There is no generic name for this function.

LLT Function 

LLT(arg1, arg2) is a specific function that returns a logical result
indicating whether arg1 is lexically less than arg2.  The arguments are
character strings.  The result is true if arg1 precedes arg2 in the ASCII
collating sequence.  In all other cases, the result is false.  If arg1 
and arg2 have unequal lengths, the shorter operand is treated as if
padded on the right with blanks to the length of the longer operand.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to i    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| i = LLT('ABC', 'BC')      | T                         |
|                           |                           |
| i = LLT('BC', 'ABC')      | F                         |
|                           |                           |

| i = LLT('ABC', 'ABC')     | F                         |
|                           |                           |
---------------------------------------------------------

There is no generic name for this function.

LOG Function 

LOG(arg) is a generic function that returns the natural logarithm
(logarithm base e) of a REAL*4, REAL*8, REAL*16, COMPLEX*8, or COMPLEX*16
argument; the argument must be greater than zero for REAL*4, REAL*8, and
REAL*16 arguments.  The result is the same data type as the argument.

Examples 

---------------------------------------------------------------------------
|                       |                                                 |
|     Function Call     |               Value Returned to a               |
|                       |                                                 |
---------------------------------------------------------------------------
|                       |                                                 |
| a = LOG(6.0)          | 1.791795                                        |
|                       |                                                 |
| a = LOG(6.0D0)        | 1.791759469228055                               |
|                       |                                                 |
| a = LOG(var1)         | (1.7917595, 0.00), where var1 = (6.0D0, 0D0)    |
|                       |                                                 |
---------------------------------------------------------------------------

The specific function names are ALOG for REAL*4 arguments, CLOG for
COMPLEX*8 arguments, DLOG for REAL*8 arguments, QLOG for REAL*16, and
ZLOG and CDLOG for COMPLEX*16 arguments.

LOG10 Function 

LOG10(arg) is a generic function that returns the common logarithm
(logarithm base 10) of a REAL*4, REAL*8, or REAL*16 argument; the
argument must be greater than zero.  The result is the same data type as
the argument.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to a    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| a = LOG10(6.0)            | 0.7781513                 |
|                           |                           |
| a = LOG10(6.0D0)          | 0.778151250383644         |
|                           |                           |
---------------------------------------------------------

The specific function names are ALOG10 for REAL*4 arguments, DLOG10 for
REAL*8 arguments, and QLOG10 for REAL*16 arguments.

MAX Function 

MAX(arg1,arg2,...)  is a generic function that returns the largest value
from the list of arguments.  The arguments can be INTEGER*4, REAL*4,
REAL*8, or REAL*16.  The number of arguments can vary, but there must be
at least two.  The result is the same data type as the arguments.

Examples 

------------------------------------------------------------------
|                                    |                           |
|           Function Call            |    Value Returned to a    |
|                                    |                           |
------------------------------------------------------------------
|                                    |                           |
| a = MAX(5, -2, 54, 11, 52)         | 54                        |
|                                    |                           |
| a = MAX(5.0, 43.24, 44.1, 78.2)    | 78.2                      |
|                                    |                           |
------------------------------------------------------------------

The function names are AMAX0, AIMAX0, and AJMAX0 for INTEGER*4 arguments
with a REAL*4 result; AMAX1 for REAL*4 arguments; DMAX1 for REAL*8
arguments; QMAX1 for REAL*16 arguments; MAX0, IMAX0, and JMAX0 for
INTEGER*4 arguments; and MAX1, IMAX1, and JMAX1 for REAL*4 arguments with
an INTEGER*4 result.

MAX1 behaves differently when either NOSTANDARD INTRINSICS or HP9000_300
is on.

MIN Function 

MIN(arg1,arg2[,...])  is a generic function that returns the smallest
value from the list of arguments.  The arguments can be INTEGER*4,
REAL*4, REAL*8, or REAL*16; the number of arguments can vary, but there
must be at least two.  The result is the same data type as the arguments.

Examples 

------------------------------------------------------------------
|                                    |                           |
|           Function Call            |    Value Returned to a    |
|                                    |                           |
------------------------------------------------------------------
|                                    |                           |
| a = MIN(5, -2, 54, 11, 52)         | -2                        |
|                                    |                           |
| a = MIN(5.0, 43.24, 44.1, 78.2)    | 5.0                       |
|                                    |                           |
------------------------------------------------------------------

The function names are AMIN0, AIMIN0, and AJMIN0 for INTEGER*4 arguments
with a REAL*4 result; AMIN1 for REAL*4 arguments; DMIN1 for REAL*8
arguments; QMIN1 for REAL*16 arguments; MIN0, JMIN0, and IMIN0 for
INTEGER*4 arguments; and MIN1, IMIN1, and JMIN1 for REAL*4 arguments with
an INTEGER*4 result.

MIN1 behaves differently when either NOSTANDARD INTRINSICS or HP9000_300
is on.

MOD Function 

MOD(arg1,arg2)) is a generic function that divides arg1 by arg2 and
returns the remainder.  The argument types can be INTEGER*4, REAL*4,
REAL*8, or REAL*16.  The result is the same data type as the arguments.
If arg2 is zero, the result is undefined.

Examples 

---------------------------------------------------------
|                           |                           |
|       Function Call       |    Value Returned to a    |
|                           |                           |
---------------------------------------------------------
|                           |                           |
| a = MOD(30,13)            | 4                         |
|                           |                           |
| a = MOD(30.0, 13.0)       | 4.0                       |
|                           |                           |
| a = MOD(5, -3)            | 2                         |
|                           |                           |
| a = MOD(-5, 3)            | -2                        |
|                           |                           |
| a = MOD(-5, -3)           | -2                        |
|                           |                           |
---------------------------------------------------------

The specific function names are MOD and JMOD for INTEGER*4 arguments,
AMOD for REAL*4 arguments, DMOD for REAL*8 arguments, QMOD for REAL*16
arguments, and HMOD and IMOD for INTEGER*2 arguments.

MVBITS Subroutine 

MVBITS(arg1, arg2, arg3, arg4, arg5) is a subroutine that moves arg3 bits
starting from position arg2 of arg1 to position arg5 of arg4.  The
portion of arg4 not affected by the movement of bits remains unchanged.
All arguments are INTEGER*4 expressions, except arg4, which must be an
INTEGER*4 variable or array element.  Arguments arg1 and arg4 can be the
same numeric storage unit.  The value of arg2 + arg3 cannot exceed the
bit length of arg1 and the value of (arg5 + arg3) cannot exceed the bit
length of arg4.

Bit positions are numbered from right to left, with the rightmost (least
significant) bit numbered zero.  Figure B-1  shows how the MVBITS
subroutine works.

[]
Figure B-1. MVBITS Subroutine NINT Function NINT(arg) is a generic function that returns the nearest integer. The argument can be REAL*4, REAL*8, or REAL*16; the result is INTEGER*4. If arg exceeds the largest integer allowed, the result is undefined. If the argument is positive or zero, the result is equal to INT(arg + 0.5). If the argument is negative, the result is equal to INT(arg - 0.5). Examples --------------------------------------------------------- | | | | Function Call | Value Returned to i | | | | --------------------------------------------------------- | | | | i = NINT(123.456) | 123 | | | | | i = NINT(123.987) | 124 | | | | | i = NINT(123.5) | 124 | | | | | i = NINT(-123.456) | -123 | | | | | i = NINT(-123.987) | -124 | | | | --------------------------------------------------------- The function names are NINT, ININT, and JNINT for REAL*4 arguments; IIDNNT, JIDNNT, and IDNINT for REAL*8 arguments; and IQNINT, IIQNNT, and JIQNNT for REAL*16 arguments. NINT, IDNINT, and IQNINT behave differently when either NOSTANDARD INTRINSICS or HP9000_300 is on. See chapter 7 for more information. NOT Function NOT(arg) is a generic function that returns the bitwise complement of an INTEGER*4 argument. The result is INTEGER*4. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to i | | | | --------------------------------------------------------- | | | | i = NOT(1) | -2 | | | | | i = NOT(0) | -1 | | | | | i = NOT(5) | -6 | | | | | i = NOT(-1) | 0 | | | | --------------------------------------------------------- The preceding examples show the use of twos complement arithmetic. The specific function names are NOT and JNOT for INTEGER*4 arguments and HNOT and INOT for INTEGER*2 arguments. QEXT Function QEXT(arg) is a generic function that converts the argument to REAL*16. The argument can be INTEGER*4, REAL*4, REAL*8, REAL*16, COMPLEX*8, or COMPLEX*16. For an INTEGER*4, REAL*4, or REAL*8 argument, the result is as much precision of the significant part of the argument as the argument can provide. For a REAL*16 argument, the result is the argument. For a COMPLEX*8 or COMPLEX*16 argument, the result is as much precision of the significant real part of the argument as the argument can provide. Examples ---------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | ---------------------------------------------------------- | | | | a = QEXT(4) | 4.0 | | | | | a = QEXT(4.0) | 4.0 | | | | | a = QEXT(4.0D2) | 400.0 | | | | | a = QEXT(var1) | 4.0, where var1=(4.00, 2) | | | | ---------------------------------------------------------- The specific function name is QEXTD for REAL*8 arguments. QNUM Function QNUM(arg) is a specific function that returns the REAL*16 value represented in the character string arg. Blanks are not significant in the input string. Examples ------------------------------------------------------------------- | | | | Function Call | Value Returned to d8 | | | | ------------------------------------------------------------------- | | | | q16 = QNUM('123.5') | 123.5 | | | | | q16 = QNUM('-99.25') | -99.25 | | | | | q16 = QNUM('327.125E75') | 3.27125e+77 | | | | | q16 = QNUM(' 24 5 ') | 245.0 | | | | ------------------------------------------------------------------- There is no generic name for this function. QPROD Function QPROD(arg1,arg2) is a specific function that returns the REAL*16 product of two REAL*8 arguments (arg1* arg2). The result is a REAL*16 number with none of the fractional portion lost and is equal to QEXT(arg1) * QEXT(arg2). Examples ---------------------------------------------------------------------- | | | | Function Call | Value Returned to q | | | | ---------------------------------------------------------------------- | | | | q = QPROD(2.2d0, 2.2d0) | 4.84000000000000078159700933611024 | | | | | q = QPROD(1.0d0, 2.0d0) | 2.0 | | | | ---------------------------------------------------------------------- There is no generic name for this function. REAL Function REAL(arg) is a generic function that converts an argument to a REAL*4 number. The argument can be INTEGER*4, REAL*4, REAL*8, REAL*16, COMPLEX*8, or COMPLEX*16. If arg is REAL*4, the result is equal to arg. If arg is INTEGER*4, REAL*8, or REAL*16 the result is as much precision of the significant part of arg as a REAL*4 item can contain. For a COMPLEX*8 argument (ar,ai), the result is ar. For a COMPLEX*16 argument (ar,ai), the result is as much significance of ar as a REAL*4 data item can contain. Examples ------------------------------------------------------------------- | | | | Function Call | Value Returned to r | | | | ------------------------------------------------------------------- | | | | r = REAL(5) | 5.0 | | | | | r = REAL(5.5) | 5.5 | | | | | r = REAL(5.55555D2) | 555.555 | | | | | r = REAL(var) | 5.5, where var = (5.5, 5) | | | | ------------------------------------------------------------------- The specific function names are FLOATI and FLOATJ for INTEGER*4 arguments, SNGL for REAL*8 arguments, and SNGLQ for REAL*16 arguments. RNUM Function RNUM(arg) is a specific function that returns the REAL*4 value represented in the character string arg. Blanks are not significant in the input string. Examples ------------------------------------------------------------------- | | | | Function Call | Value Returned to r4 | | | | ------------------------------------------------------------------- | | | | r4 = RNUM('123.5') | 123.5EO | | | | | r4 = RNUM('-99.25') | -99.25EO | | | | | r4 = RNUM('327.125E15') | 327.125E15 | | | | | r4 = RNUM(' 24. 5 ') | 24.5 (blanks are ignored) | | | | ------------------------------------------------------------------- There is no generic name for this function. SIGN Function SIGN(arg1,arg2) is a generic function that transfers the sign from one numeric value to another. SIGN(arg1,arg2) returns the magnitude of arg1 with the sign of arg2. The arguments can be INTEGER*4, REAL*4, REAL*8, or REAL*16. The result is the same data type as the arguments. The result is arg1 if arg2 is positive or zero, and arg1 if arg2 is negative. Examples ------------------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | ------------------------------------------------------------------- | | | | a = SIGN(45.84, -133.0) | -45.84 | | | | | a = SIGN(45.84, 133.0) | 45.84 | | | | | a = SIGN(-45.84, -133.0) | -45.84 | | | | ------------------------------------------------------------------- The specific function names are SIGN for REAL*4 arguments, DSIGN for REAL*8 arguments, QSIGN for REAL*16, JISIGN for INTEGER*4 arguments, and HSIGN and IISIGN for INTEGER*2 arguments. ISIGN can also be used as a generic function name for integer arguments, and accepts INTEGER*2 and INTEGER*4 arguments. SIN Function SIN(arg) is a generic function that returns the sine of the argument. The argument is expressed in radians and is REAL*4, REAL*8, REAL*16, or COMPLEX*8. The result is the same data type as the argument. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | --------------------------------------------------------- | | | | a = SIN(0.0) | 0.0 | | | | | a = SIN(1.5708) | 1.0 | | | | | a = SIN(0.0628) | 0.06275873 | | | | --------------------------------------------------------- The specific function names are SIN for REAL*4 arguments, DSIN for REAL*8 arguments, QSIN for REAL*16 arguments, CSIN for COMPLEX*8 arguments, and ZSIN and CDSIN for COMPLEX*16 arguments. SIND Function SIND(arg) is a generic function that returns the sine of the argument. The argument is expressed in degrees and is REAL*4, REAL*8, or REAL*16. The result is the same data type as the argument. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | --------------------------------------------------------- | | | | a = SIND(30.0) | .500000 | | | | | a = SIND(20.0) | .342020 | | | | | a = SIND(45.0D0) | .7071067811865476 | | | | --------------------------------------------------------- The specific function names are SIND for REAL*4 arguments, DSIND for REAL*8 arguments, and QSIND for REAL*16 arguments. SINH Function SINH(arg) is a generic function that returns the hyperbolic sine of a REAL*4, REAL*8, or REAL*16 argument. The result is the same data type as the argument. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | --------------------------------------------------------- | | | | a = SINH(0.0) | 0.0 | | | | | a = SINH(1.5708) | 2.3013079 | | | | --------------------------------------------------------- The specific function names are SINH for REAL*4 arguments, DSINH for REAL*8 arguments, and QSINH for REAL*16 arguements. SIZEOF Function SIZEOF(arg) is a generic function that returns the number of bytes of storage used by the argument. The argument cannot be a dynamic or assumed-size array; any other argument with a valid data type is allowed, including constants and arbitrary expressions. SQRT Function SQRT(arg) is a generic function that returns the square root of a REAL*4, REAL*8, REAL*16, COMPLEX*8, or COMPLEX*16 argument. The result is the same data type as the argument. The argument cannot be negative for REAL*4 and REAL*8 values. Examples ---------------------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | ---------------------------------------------------------------------- | | | | a = SQRT(9.0) | 3.0 | | | | | a = SQRT(49.0D0) | 7.0 | | | | | a = SQRT(var) | (5.0, 0.0), where var = (25, 0.0) | | | | ---------------------------------------------------------------------- The specific function names are SQRT for REAL*4 arguments, CSQRT for COMPLEX*8 arguments, DSQRT for REAL*8 arguments, QSQRT for REAL*16 arguments, and ZSQRT and CDSQRT for COMPLEX*16 arguments. TAN Function TAN(arg) is a generic function that returns the tangent of the argument. The argument is expressed in radians, and its type is REAL*4, REAL*8, REAL*16, COMPLEX*8, or COMPLEX*16. The value of arg must be less than or equal to the maximum number allowed on your system and not close to (+-(2n + 1) * pi /2), where n is an INTEGER*4. The result is the same data type as the argument. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | --------------------------------------------------------- | | | | a = TAN(3.0) | -0.1425465 | | | | | a = TAN(1.0) | 1.5574077 | | | | --------------------------------------------------------- The specific function names are TAN for REAL*4 arguments, DTAN for REAL*8 arguments, QTAN for REAL*16, CTAN for COMPLEX*8 arguments, and ZTAN for COMPLEX*16 arguments. TAND Function TAND(arg) is a generic function that returns the tangent of the argument. The argument is expressed in degrees, and its type is REAL*4, REAL*8, or REAL*16. The result is the same data type as the argument. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | --------------------------------------------------------- | | | | a = TAND(3.0) | 0.0524078 | | | | | a = TAND(3.0D1) | .5773502691896257 | | | | --------------------------------------------------------- The specific function names are TAND for REAL*4 arguments, DTAND for REAL*8 arguments, and QTAND for REAL*16. TANH Function TANH(arg) is a generic function that returns the hyperbolic tangent of a REAL*4, REAL*8, or REAL*16 argument. The result is the same data type as the argument. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to a | | | | --------------------------------------------------------- | | | | a = TANH(3.0) | 0.9950548 | | | | | a = TANH(1.0) | .7615942 | | | | --------------------------------------------------------- The specific function names are TANH for REAL*4 arguments, DTANH for REAL*8 arguments, and QTANH for REAL*16 arguments. ZEXT Function ZEXT(arg) is a generic function that returns a fixed-point argument of the same size or larger without extending the sign bit of the argument. The size of the result depends on whether the SHORT directive is enabled. If SHORT is enabled, ZEXT behaves like IZEXT and returns an INTEGER*2 result. If SHORT is not enabled, ZEXT behaves like JZEXT and returns an INTEGER*4 result. (IZEXT and JZEXT are explained below.) ZEXT behaves differently when either NOSTANDARD INTRINSICS or HP9000_300 is on. See chapter 7 for more information. If SHORT is on, ZEXT returns an INTEGER*2; if LONG is on, it returns an INTEGER*4. In the following examples, i4 is an INTEGER*4 variable and SHORT is not enabled. Examples --------------------------------------------------------- | | | | Function Call | Value Returned to i4 | | | | --------------------------------------------------------- | | | | i4 = ZEXT(-32768i) | 32768j* | | | | | i4 = ZEXT(-1) | 65535j | | | | --------------------------------------------------------- * Note that i4 = -32768i would assign -32768j to i4. IZEXT is a generic function that accepts LOGICAL*1, LOGICAL*2, or INTEGER*2 arguments, and returns an INTEGER*4 result. JZEXT is a generic function that accepts LOGICAL*1, LOGICAL*2, LOGICAL*4, INTEGER*2 or INTEGER*4 arguments, and returns an INTEGER*4 result. The specific function names are IZEXT for INTEGER*2 arguments and JZEXT for INTEGER*4 arguments. IZEXT accepts an INTEGER*2 argument and returns an INTEGER*2 result. JZEXT accepts either an INTEGER*2 or INTEGER*4 argument and returns an INTEGER*4 result.


MPE/iX 5.0 Documentation