SFRAC/DFRAC

Extract fractional parts

Name

SFRAC/DFRAC

 

Extract fractional parts

Purpose

Given a real vector x of length n, these subprograms extract the fractional

 

portions of the elements of x and return them in a vector y.

 

The vectors can be stored in one-dimensional arrays or in either rows or

 

columns of two-dimensional arrays. Indexing through the arrays can be either

 

forward or backward.

Usage

VECLIB:

 

INTEGER*4

n, incx, incy

 

 

REAL*4

x(lenx), y(leny)

 

 

CALL SFRAC(n, x, incx, y, incy)

 

 

INTEGER*4

n, incx, incy

 

 

REAL*8

x(lenx), y(leny)

 

 

CALL DFRAC(n, x, incx, y, incy)

 

 

VECLIB8:

 

 

 

INTEGER*8

n, incx, incy

 

 

REAL*4

x(lenx), y(leny)

 

 

CALL SFRAC(n, x, incx, y, incy)

 

 

INTEGER*8

n, incx, incy

 

 

REAL*8

x(lenx), y(leny)

 

 

CALL DFRAC(n, x, incx, y, incy)

 

Input

n

Number of elements of vectors x and y to be used. If

 

 

n ≤ 0, the subprograms do not reference x or y.

 

x

Array of length lenx = (n−1)⋅incx+1 containing the

 

 

n-vector x.

 

 

incx

Increment for the array x:

 

 

incx ≥ 0

x is stored forward in array x; that is,

 

 

 

xi is stored in x((i−1)⋅incx+1).

 

 

incx < 0

x is stored backward in array x; that

 

 

 

is, xi is stored in x((in)⋅incx+1).

 

 

Use incx = 1 if the vector x is stored contiguously in

 

 

array x; that is, if xi is stored in x(i). Refer to “BLAS

 

 

Indexing Conventions” in the introduction to this

 

 

chapter.

 

 

incy

Increment for the array y, incy ≠ 0:

92HP MLIB User’s Guide