[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

rsqrt Subroutine

Purpose

Computes the reciprocal of the square root of a number.

Libraries

IEEE Math Library (libm.a)

System V Math Library (libmsaa.a)

Syntax


#include <math.h>

double rsqrt(double x)

Description

The rsqrt command computes the reciprocal of the square root of a number x; that is, 1.0 divided by the square root of x (1.0/sqrt(x)). On some platforms, using the rsqrt subroutine is faster than computing 1.0 / sqrt(x). The rsqrt subroutine uses the same rounding mode used by the calling program.

When using the libm.a library, the rsqrt subroutine responds to special values of x in the following ways:

When using the libmsaa.a library, the rsqrt subroutine responds to special values of x in the following ways:

When compiled with libmsaa.a, a program can use the matherr subroutine to change these error-handling procedures.

Parameter

x Specifies a double-precision floating-point value.

Return Values

Upon successful completion, the rsqrt subroutine returns the reciprocal of the square root of x.

1.0 If x is 1.0.
+0.0 If x is +INF.

Error Codes

When using either the libm.a or libmsaa.a library, the rsqrt subroutine may return the following error code:

EDOM The value of x is negative.

Related Information

The matherr subroutine, sqrt or cbrt (sqrt, sqrtf, or sqrtl Subroutine) subroutine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]