v?Round

Computes a value rounded to the nearest integer for each vector element.

Syntax

FORTRAN:

call vsround( n, a, y )

call vmsround( n, a, y, mode )

call vdround( n, a, y )

call vmdround( n, a, y, mode )

C:

vsRound( n, a, y );

vmsRound( n, a, y, mode );

vdRound( n, a, y );

vmdRound( n, a, y, mode );

Include Files

Input Parameters

Name

Type

Description

n

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const int

Specifies the number of elements to be calculated.

a

FORTRAN 77: REAL for vsround, vmsround

DOUBLE PRECISION for vdround, vmdround

Fortran 90: REAL, INTENT(IN) for vsround, vmsround

DOUBLE PRECISION, INTENT(IN) for vdround, vmdround

C: const float* for vsRound, vmsround

const double* for vdRound, vmdround

FORTRAN: Array that specifies the input vector a.

C: Pointer to an array that contains the input vector a.

mode

FORTRAN 77: INTEGER*8

Fortran 90: INTEGER(KIND=8), INTENT(IN)

C: const MKL_INT64

Overrides global VML mode setting for this function call. See vmlSetMode for possible values and their description.

Output Parameters

Name

Type

Description

y

FORTRAN 77: REAL for vsround, vmsround

DOUBLE PRECISION for vdround, vmdround

Fortran 90: REAL, INTENT(OUT) for vsround, vmsround

DOUBLE PRECISION, INTENT(OUT) for vdround, vmdround

C: float* for vsRound, vmsround

double* for vdRound, vmdround

FORTRAN: Array that specifies the output vector y.

C: Pointer to an array that contains the output vector y.

Description

The function computes a value rounded to the nearest integer for each vector element.

The resulting mode affects the results computed for inputs that fall half-way between consecutive integres. For example:

Special Values for Real Function v?Round(x)
Argument Result Exception
+0 +0  
-0 -0  
+ +  
- -  
SNAN QNAN INVALID
QNAN QNAN  

Submit feedback on this help topic