• Keine Ergebnisse gefunden

These routines are available to users of both the COS and UNICOS operating systems

SR-Ol13

2-38

C

NEQV(3M) NEQV(3M)

NAME

NEQV - Computes the logical difference SYNOPSIS

I=NEQV(logical ,10 gical) b=NEQV(arg,arg) DESCRIPTION

arg Argument of type integer, real, or Boolean

When given two arguments of type logical, NEQV computes a logical difference and returns a logical is used instead of the actual 64-bit word.

INTEGER II, 12, I3

NEQV(3M) NEQV(3M)

101000101111101

I3 IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-0113

2-40

c

NINT(3M)

NAME

NINT, IDNINT - Finds the nearest integer (Cray Fortran intrinsic function) SYNOPSIS

i=NINT(real) i=IDNINT(double) DESCRIPTION

NINT(3M)

NINT (generic name) finds the nearest integer for real and double-precision numbers as defined by the following equations.

y=[x+.5] if x~

y=[x-.5] if x<O

The argument range for NINT is

I x I

< 246. The range for IDNINT is

I x I

< 263.

NINT and IDNINT are both type integer functions. NINT is an in-line code function.

IMPLEMENTATION

These routines are available to users of both the COS and UNlCOS operating systems .

SR-OI13 2-41

C

OR(3M) OR(3M)

NAME

OR - Computes the logical sum (Cray Fortran intrinsic function) SYNOPSIS

I=OR(logical,logical) b=OR(arg,arg) DESCRIPTION

arg Argument of type integer, real, or Boolean:

When given two arguments of type logical, OR computes a logical sum and returns a logical result.

The following section of Fortran code shows the OR function used with two arguments of type logical.

LOGICAL L1, L2, L3 L3

=

OR(Ll,L2)

The following section of Fortran code shows the OR function used with two arguments of type integer.

The bit patterns of the arguments and result are also shown below. For clarity, an 8-bit word is used instead of the actual 64-bit word.

INTEGER

n,

12, I3

OR(3M) OR(3M)

10 10 1

0

10 111111 10

1

I3

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-0113 2-43

c

POPCNT(3M) POPCNT(3M)

NAME

POPCNT - Counts the number of bits set to 1 (Cray Fortran intrinsic function) SYNOPSIS

i=POPCNT(arg) DESCRIPTION

NOTES

arg Argument of type integer, real, logical, or Boolean

When given an argument of type integer, real, logical, or Boolean, POPCNT counts the number of bits set to 1 in the 64-bit representation of the argument. POPCNT is an in-line code function.

The bit representation of the logical data type is not consistent among Cray machines. See the follow-ing manuals for further details: Fortran (CFf) Reference Manual, publication SR-0009; CRAY-2 Fortran (CFf2) Reference Manual, publication SR-2007; CFT77 Reference Manual, publication SR-OOI8.

EXAMPLES

The following section of Fortran code shows the POPCNT function used with an argument of type integer. The bit pattern of the argument and the value of the result are also shown below. For clarity, a 16-bit word is used instead of the actual 64-bit word.

INTEGER II, 12 12

=

POPCNT(Il)

10 I 0 1 0 I 0 1 0 1111 1 0 I 0 111111 1 0 1 0 11 1 0 1 11

The POPCNT function returns the value 6 to the integer variable 12.

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-0113

2-44

C

POPPAR(3M) POPPAR(3M)

NAME

POPPAR - Computes the bit population parity (Cray Fortran intrinsic function) SYNOPSIS

i=POPPAR(arg) DESCRIPTION

NOTES

arg Argument of type integer, real, logical, or Boolean

When given an argument of type integer, real, logical, or Boolean, POPPAR returns the value 0 if an even number of bits are set to 1 in the 64-bit representation of the argument or the value 1 if an odd number of bits are set to 1 in the 64-bit representation of the argument. POPPAR is an in-line code function.

The bit representation of the logical data type is not consistent among Cray machines. See the follow-ing manuals for further details: Fortran (CFT) Reference Manual, publication SR-0009; CRAY-2 Fortran (CFf2) Reference Manual, publication SR-2007; CFf77 Reference Manual, publication SR-OOI8.

EXAMPLES

The following section of Fortran code shows the POPPAR function used with an argument of type integer. The bit pattern of the argument and the value of the result are also shown below. For clarity, a 16-bit word is used instead of the actual 64-bit word.

INTEGER 11, 12 12

=

POPP AR(I1)

10 1 0 1 0 1 0

I

0 1111 1 0

I

0 111111 1 0 1 0 11 1 0 1 11

The POPPAR function returns the value 0 to the integer variable 12.

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-OI13 2-45 C

RAN(3M) RAN(3M)

NAME

RANF, RANGET, RANSET - Computes pseudo-random numbers (Cray Fortran intrinsic function) SYNOPSIS

r=RANF( )

r=RANGET([integerD r=RANSET(integer) DESCRIPTION

NOTE

These CRI extension functions compute pseudo-random numbers and either set or retrieve a seed.

RANF obtains the first or next in a series of pseudo-random numbers, such that

O<y<l,

in the form of a normalized floating-point number. RANF uses a null argument.

RANGET obtains a seed. RANSET establishes a seed such that y=x. RANGET has an optional integer argument and RANSET a required integer argument in the range of

I x I

< in f .

When the seed of the random number generator is reset, RANSET does not store the supplied argument as the first value in the buffer of the random number seeds.

EXAMPLES

DO 101=1,10

10 RANDOM(I)=RANFO

CALL RANGET(iseedl)

C

or

iseed=RANGET( )

CALL RANSET(ivalue)

C

or

dummy=RANSET(ivalue)

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-0113 ·2-46 C

REAL(3M)

NAME

REAL, FLOAT, SNGL - Converts to type real (Cray Fortran intrinsic function) SYNOPSIS

r=REAL(arg) r=FLOAT(integer) r=SNGL(double) r=SNGL(boolean) DESCRIPTION

arg Argument of type complex, integer, or real

REAL(3M)

REAL (generic name) converts types to type real, such that)'=x (or y=xr for complex arguments). All of these functions are inline Fortran code.

The range for REAL complex and real arguments is

I

x

I

< in f • The range for FLOAT integer arguments is

I

x 1<246.

The range for SNGL Boolean and double-precision arguments is

I

Xr

1<

info Type conversion routines assign the appropriate type to Boolean arguments without shifting or maniputlating the bit patterns they represent.

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-Ol13

2-47

c

SHIFf(3M) SlllFf(3M)

argl Argument of type integer, real, logical, or Boolean specifying the value to be shifted arg2 Argument of type integer specifying the number of bits to shift the value

For arg2 in the range 0:C:::;arg2:C:::;64, SIDFf performs a left circular shift of the 64-bit representation of argl by arg2 bits.

For arg2~65, a left circular shift is not performed. Instead, SHIFf is defined as follows when arg2~65.

For arg2 in the range 65:C:::;arg2:C:::;128, SIDFT(argl,arg2) is defined as SIDFfL(argl,arg2-64). See SIDFfL(3M).

For arg2 in the range 129~rg2:C:::;224-1, SlUFf returns a value with all bits set to O.

For arg2 in the range 224~g2<oo, SHIFT returns an undefined result.

The bit representation of the logical data type is not consistent among Cray machines. See the follow-ing manuals for further details: Fortran (CFT) Reference Manual, publication SR-0009; CRAY-2 Fortran (CFT2) Reference Manual, publication SR-2007; CFT77 Reference Manual, publication SR-OOI8.

EXAMPLES

The following section of Fortran code shows the SHIFT function used in the case where arg 1 is of type integer. For purposes of clarity, a 16-bit word is used instead of the actual 64-bit word. The bit pattern of argl and the bit pattern of the result are also shown below.

SIDFrL(3M) SIDFrL(3M)

NAME

SIDFfL - Performs a left shift with zero fill SYNOPSIS

b=SHIFTL(argl,arg2) DESCRIPTION

NOTES

argl Argument of type integer, real, logical, or Boolean specifying the value to be shifted arg2 Argument of type integer specifying the number of bits to shift the value

For arg2 in the range lli;arg2~224-I, SIDFTL performs a left shift with zero fill of the 64-bit representa-tion of argl by arg2 bits. Note that when arg2 is in the range 64~arg2~224-1, SHIFTL returns a value with all bits set to O.

For arg2 in the range 224~arg2<oo, SIDFfL returns an undefined result.

The bit representation of the logical data type is not consistent among Cray machines. See the follow-ing manuals for further detail's: Fortran (CFf) Reference Manual, publication SR-0009; CRA Y-2 Fortran (CFf2) Reference Manual, publication SR-2007; CFf77 Reference Manual, publication SR-0018.

EXAMPLES

The following section of Fortran code shows the SmFTL function used in the case where argl is of type integer. The bit pattern of argl and the bit pattern of the result are also shown below. For pur-poses of clarity, a 16-bit value is used instead of a 64-bit value.

INTEGER II, 12, I3 12

=

5

I3

=

SHIFTL(l1,I2)

1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 II (argl)

111111 1 0 1 0 1 0 1 0 1 0 1 0 I 0 1 0 1 0 1 0 I 0 I 0 I 01 I3 (result)

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-0113 2-49

c

SIDFfR(3M) SIllFfR(3M)

NAME

SHIFTR - Performs a right shift with zero fill SYNOPSIS

b=SHIFTR(argl,arg2) DESCRIPTION

NOTES

argl Argument of type integer, real, logical, or Boolean arg2 Argument of type integer

For arg2 in the range 0~rg2~24-I, SHIFTR performs a right shift with zero fill of the 64-bit represen-tation of argl by arg2 bits. Note that when arg2 is in the range 64~arg2~224-I, SHIFTR returns a value with all bits set to O.

For arg2 in the range 224~rg2<oo, SHIFTR returns an undefined result.

The bit representation of the logical data type is not consistent among Cray machines. See the follow-ing manuals for further details: Fortran (CFT) Reference Manual, publication SR-0009; CRAY-2 Fortran (CFT2) Reference Manual, publication SR-2007; CFf77 Reference Manual, publication SR-OOI8.

EXAMPLES

The following section of Fortran code shows the SHIFfR function used in the case where argl is of type integer. The bit pattern of argl and the bit pattern of the result are also shown below. For pur-poses of clarity, a 16-bit value is used instead of a 64-bit value.

INTEGER

11,

12, I3

12 = 5

I3

=

SHIFIR(Il ,12)

1111 1 1 1 1 11110101010101010101

11 (argl)

10 10 I 0 I 0 10 111111 10 10 I 0 10 I 0 I 0 I 0 1

0

1

I3 (result) IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-OI13 2-50 C

SIGN(3M)

NAME

SIGN, ISIGN, DSIGN - Transfers sign of numbers (Cray Fortran intrinsic function) SYNOPSIS

r=SIGN (real ,real) i=ISIGN(integer,integer) d=DSIGN (double ,double) DESCRIPTION

SIGN(3M)

SIGN (generic name) evaluates one of the following equations, depending on the sign of the number.

y =

I x

1

I

if

x

2~

or y =

-I x

1

I

if

x 2<0

The argument range for all transfer sign functions is

I x

1

I , I

x21 < inf. All of these functions are inline Fortran code.

IMPLEMENTATION

These routines are available to users of both the cos and VNIeOS operating systems.

SR-0113 2-51 C

SIN(3M)

NAME

SIN, DSIN, CSIN - Computes the sine (Cray Fortran intrinsic function) SYNOPSIS

r=SIN(real) d=DSIN(double) z=CSIN(complex) DESCRIPTION

SIN(3M)

SIN (generic name) solves the equation y=sin(x). The ranges for the real, double-precision, and complex functions are as follows:

For SIN:

For DSIN:

I

x 1<248

For CSIN:

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-0113 2-52

c

SINH (3M)

NAME

SINH, DSINH - Computes the hyperbolic sine (Cray Fortran intrinsic function) SYNOPSIS

r=SINH(real) d=DSINH(double) DESCRIPTION

SINH (3M)

SINH (generic name) solves the equation y=sinh(x). The hyperbolic sine functions have a real or double-precision argument in the range of

I x I

< 213

*

In 2.

IMPLEMENTATION

These routines are available to users of both the COS and UNICOS operating systems.

SR-Ol13 2-53 C

SQRT(3M)

NAME

SQRT, DSQRT, CSQRT -

Computes the square root (Cray Fortran intrinsic function)