SCALE (X,I)
F90 Numeric Elemental. Changes X exponent by I, multiplying X by bI.
Arguments X real or complex. I integer.
Signals. Same as X. Units... Same as X. Form.... Same as X.
Result.. X*bI, where b is the base of real model numbers, provided the result is within range.
Example. SCALE(3.0,2) is 12.0 on the VAX.
SCAN (STRING,SET,[BACK])
F90 Character Elemental. Scan a string for a character in a set.
Arguments Optional: BACK. STRING character. SET character. BACK logical.
Signals. Single signal or smallest data. Units... Same as STRING. Form.... Integer type, compatible shape of all.
Result.. The result is -1 if STRING does not contain any of the characters that are in SET of if the length of STRING or SET is zero. (i) BACK is absent or false. The offset of the leftmost character of STRING that is in SET. (ii) BACK present and true. The offset of the rightmost character of STRING that is in SET.
Examples. SCAN('FORTRAN','TR') is 2. SCAN('FORTRAN','TR',$TRUE) is 4. SCAN('FORTRAN','BCD') is -1.
See also. VERIFY to check that all character are in a set.
SELECTED_INT_KIND (R)
F90 Inquiry. The kind value of an integer that will represent the number of decimal digits.
Argument. R must be a scalar integer.
Signality. None. Units... None. Form.... Scalar integer.
Result.. A value equal to the kind type parameter of an integer data type that represents all values with between -10R and 10R, or if no such kind is available, the result is -1. If more than one kind meets the criteria, the result is the one with the smallest range.
Example. SELECTED_INT_KIND(6) is 8 (DSC$K_DTYPE_L) on the VAX.
SELECTED_REAL_KIND ([P],[R])
F90 Inquiry. The kind value of an real that will represent the number of decimal digits and the decimal exponent range.
Argument. Optional: P and R must be a scalar integers.
Signality. None. Units... None. Form.... Scalar integer.
Result.. A value equal to the kind type parameter of a real data type with decimal precision, as returned by PRECISION, of at least P digits and exponent range, as returned by RANGE of at least R. If no such kind is available the result is -1 if the precision is not available, -2 if the exponent is not available, or -3 if neither. If more than one kind meets the criteria, the result is the one with the smallest decimal precision.
Example. SELECTED_REAL_KIND(6,30) is 10 (DSC$K_DTYPE_F) on the VAX.
SET_EXPONENT (X,I)
F90 Numeric Elemental. Model number whose fractional part is the fractional part is that of X and whose exponent part is I.
Arguments X real or complex. I integer.
Signals. Same as X. Units... Same as X. Form.... Same as X.
Result.. X*b(I-e), where b is the real number base and e is exponent offset.
Example. SET_EXPONENT(3.0,1) is 1.5 on the VAX.
SET_RANGE ([BOUND],...ARRAY)
Transformation. Set array bounds and multipliers from a list.
Arguments Optional: BOUND,.... BOUND,... integer scalar or range, they are taken from ARRAY where omitted. ARRAY any type scalar, vector, or array.
Signals. Same as ARRAY. Units... Same as ARRAY. Form.... Same type as ARRAY with shape from the bounds list. Any omitted bounds are picked from the corresponding bounds of ARRAY.
Result.. Elements in array order from ARRAY. Immediate at compilation even if all but last argument are ranges and provided last argument is an array.
Examples.
_A=SET_RANGE(2:3,5,1:10) is [1 3 5 7 9].
[2 4 6 8 10]
SET_RANGE(-2:,:3,_A) has LBOUND(_A,0) of [-2,-1] and
UBOUND(_A,1) of [-1,3].
SHAPE (SOURCE,[DIM])
F90 Inquiry. The shape of an array or a scalar.
Arguments OPTIONAL: DIM (To follow F90 use SIZE with a DIM). SOURCE any type scalar, array, or signal. DIM integer scalar from 0 to n-1, where n is rank of SOURCE.
Signals. None. Units... None. Form.... Integer vector of size equal to rank of SOURCE.
Result.. The declared shape of SOURCE for subscript DIM of SOURCE. If no bounds were declared it is one less than the multiplier for subscript DIM of SOURCE. SHAPE(ARRAY) has value whose j-th component is equal to SHAPE(ARRAY,j) for each j, 0 to n-1.
Examples. SHAPE(_A[2:5,-1:1]) is [4,3]. SHAPE(3) is [], a zero-length vector.
See also LBOUND for lower bound, UBOUND for upper bound, SIZE for total elements, and E... for signals.
SHIFT_LEFT (I,SHIFT)
Numeric Elemental. Logical or arithmetic left shift of an element. Usual Form I << SHIFT. Function Form SHIFT_LEFT(I,SHIFT).
Arguments I must be integer. Octaword is not supported. SHIFT must be integer, must be positive. The low byte is used.
Signals. Single signal or smaller data. Units... Same as I. Form.... Type of I, compatible shape of all.
Result.. The bits of I shifted SHIFT positions left. (i) For unsigned numbers, the vacated bits are cleared. (ii) For signed numbers, an arithmetic shift if SHIFT is from 0 to the size in bits; otherwise, undefined.
Examples. (i) 0X12UB << 4 is 0X20UB. (ii) 0X12SB << 4 is 0X20UB on the VAX.
SHIFT_RIGHT (I,SHIFT)
Numeric Elemental. Logical or arithmetic right shift of an element. Usual Form I >> SHIFT. Function Form SHIFT_RIGHT(I,SHIFT).
Arguments I must be integer. Octaword is not supported. SHIFT must be integer. The low byte is used.
Signals. Single signal or smaller data. Units... Same as I. Form.... Type of I, compatible shape of all.
Result.. The bits of I shifted SHIFT positions right. (i) For unsigned numbers, the vacated bits are cleared. (ii) For signed numbers, the vacated bits are filled from the sign bit (two's complement arithmetic shift).
Examples. (i) 0X12UB >> 4 is 0X20UB. (ii) 0X89SB >> 4 is 0XF8SB.
SHOW_PRIVATE ([STRING],...)
Variable IO. Display on normal output the contents of a wildcard list of variable names or all the variables.
Arguments Optional: STRING. STRING,... character scalar with wildcards % and *. If omitted all private variables are displayed.
Result.. None.
Side Effect. Writes to stdout, SYS$OUTPUT on the VAX.
Example. _A = 42, SHOW_PRIVATE("_A") produces Private _A = 42
SHOW_PUBLIC ([STRING],...)
Variable IO. Display on normal output the contents of a wildcard list of variable names or all the variables.
Arguments Optional: STRING. STRING,... character scalar with wildcards % and *. If omitted all public variables are written.
Result.. None.
Side Effect. Writes to stdout, SYS$OUTPUT on the VAX.
Example. _A = 42, SHOW_PUBLIC("_A") produces Public _A = 42
sign (A,B)
F90 Numeric Elemental. The magnitude of A with the sign of B.
Arguments A and B must be integer or real. Complex numbers are an error.
Signals. Single signal or smaller data. Units... Same as A. Form.... Type of A, compatible shape of all.
Result.. ABS(A) if B>=0 and -ABS(A) if B<0.
Example. SIGN(-3.0,2.0) is 3.0.
SIGNED (A)
Conversion Elemental. Convert to signed integer. Argument. A must be numeric.
Signals. Same as A. Units... Same as A. Form.... Signed integer of same length as real part of A.
Result.. The truncated integer. Immediate at compilation. >>>>>>>>>WARNING, truncation does not cause an error.
Example. SIGNED(3LU) is 3.
SIN (X)
F90 Mathematical Elemental. Sine of angle in radians.
Argument. X must be real or complex. HC is converted to GC.
Signals. Same as X. Units... None, bad if X has units. Form.... Same as X.
Result.. Processor approximation to sin(X). Real X and real part of complex X is in radians.
Example. SIN(1.0) is 0.84147098, approximately.
SIND (X)
Mathematical Elemental. Sine of angle in radians.
Argument. X must be real. Complex numbers are an error.
Signals. Same as X. Units... None, bad if X has units. Form.... Same as X.
Result.. Processor approximation to sin(X) with X in degrees.
Example. SIN(30.0) is 0.5, approximately.
SINH (X)
F90 Mathematical Elemental. Hyperbolic sine.
Argument. X must be real. Complex numbers are an error.
Signals. Same as X. Units... None, bad if X has units. Form.... Same as X.
Result.. Processor approximation to sinh(X).
Example. SINH(1.0) is 1.1752012, approximately.
SIZE (ARRAY,[DIM])
F90 Inquiry. The extent an array or the total declared number of elements in the array.
Arguments Optional: DIM. ARRAY any type array. DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
Signals. None. Units... None. Form.... Integer scalar.
Result.. Equal to the declared extent of dimension DIM of ARRAY or, if DIM is absent, the total declared number of elements of ARRAY.
Examples. SIZE(_A[2:5,-1:1]),1) is 3. SIZE(_A[2:5,-1:1]) is 12.
See also LBOUND for lower bound, SHAPE for number of elements, UBOUND for upper bound, and E... for signals.
SIZEOF (X)
Inquiry. Size of whole excluding descriptor.
Argument. Any VMS type. Signals. None. Units... None. Form.... Integer scalar.
Result.. The number of bytes in the evaluated expression.
Example. SIZEOF(123) is 4.
|