v?Modf

Computes a truncated integer value and the remaining fraction part for each vector element.

Syntax

FORTRAN:

call vsmodf( n, a, y, z )

call vmsmodf( n, a, y, z, mode )

call vdmodf( n, a, y, z )

call vmdmodf( n, a, y, z, mode )

C:

vsModf( n, a, y, z );

vmsModf( n, a, y, z, mode );

vdModf( n, a, y, z );

vmdModf( n, a, y, z, 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 vsmodf, vmsmodf

DOUBLE PRECISION for vdmodf, vmdmodf

Fortran 90: REAL, INTENT(IN) for vsmodf, vmsmodf

DOUBLE PRECISION, INTENT(IN) for vdmodf, vmdmodf

C: const float* for vsModf, vmsmodf

const double* for vdModf, vmdmodf

FORTRAN: Array, 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, z

FORTRAN 77: REAL for vsmodf, vmsmodf

DOUBLE PRECISION for vdmodf, vmdmodf

Fortran 90: REAL, INTENT(OUT) for vsmodf, vmsmodf

DOUBLE PRECISION, INTENT(OUT) for vdmodf, vmdmodf

C: float* for vsModf, vmsmodf

double* for vdModf, vmdmodf

FORTRAN: Array, specifies the output vector y and z.

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

Description

The function computes a truncated integer value and the remaining fraction part for each vector element.

Halfway values, such as 0.5, -1.5, are rounded off towards even values. An inexact result exception is raised for each changed value.

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

Submit feedback on this help topic