v?Hypot

Computes a square root of sum of two squared elements.

Syntax

FORTRAN:

call vshypot( n, a, b, y )

call vmshypot( n, a, b, y, mode )

call vdhypot( n, a, b, y )

call vmdhypot( n, a, b, y, mode )

C:

vsHypot( n, a, b, y );

vmsHypot( n, a, b, y, mode );

vdHypot( n, a, b, y );

vmdHypot( n, a, b, y, mode );

Include Files

Input Parameters

Name

Type

Description

n

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const int

Number of elements to be calculated.

a, b

FORTRAN 77: REAL for vshypot, vmshypot

DOUBLE PRECISION for vdhypot, vmdhypot

Fortran 90: REAL, INTENT(IN) for vshypot, vmshypot

DOUBLE PRECISION, INTENT(IN) for vdhypot, vmdhypot

C: const float* for vsHypot, vmsHypot

const double* for vdHypot, vmdHypot

FORTRAN: Arrays that specify the input vectors a and b

C: Pointers to arrays that contain the input vectors a and b.

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.

Precision Overflow Thresholds for Hypot Function
Data Type Threshold Limitations on Input Parameters
single precision

abs(a[i]) < sqrt(FLT_MAX)

abs(b[i]) < sqrt(FLT_MAX)

double precision

abs(a[i]) < sqrt(DBL_MAX)

abs(b[i]) < sqrt(DBL_MAX)

Output Parameters

Name

Type

Description

y

FORTRAN 77: REAL for vshypot, vmshypot

DOUBLE PRECISION for vdhypot, vmdhypot

Fortran 90: REAL, INTENT(OUT) for vshypot, vmshypot

DOUBLE PRECISION, INTENT(OUT) for vdhypot, vmdhypot

C: float* for vsHypot, vmsHypot

double* for vdHypot, vmdHypot

FORTRAN: Array that specifies the output vector y.

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

Description

The function v?Hypot computes a square root of sum of two squared elements.

Special values for Real Function v?Hypot(x)
Argument 1 Argument 2 Result Exception
+0 +0 +0  
-0 -0 +0  
+ any value +  
any value + +  
SNAN any value QNAN INVALID
any value SNAN QNAN INVALID
QNAN any value QNAN  
any value QNAN QNAN  

Submit feedback on this help topic