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

Computes square root and cube root functions.

or System V Math Library (**libmsaa.a**)

**#include <math.h>**

**double sqrt (** *x***)**

**double*** x***;**

long double sqrtl (x)long doublex;

double cbrt (x)doublex;

The **sqrt** subroutine,
**sqrtl** subroutine, and **cbrt** subroutine compute the square
root and cube root, respectively, of their parameters.

Note:
| Compile any routine that uses subroutines from the
libm.a library with the -lm flag. To
compile the sqrt.c file, for example, enter:
cc sqrt.c -lm |

x
| Specifies some double-precision floating-point value. |

For the **sqrt**
subroutine, if the value of *x* is negative, a NaNQ is returned and
the **errno** global variable is set to a **EDOM** value.

When using
**libmsaa.a** (**-lmsaa**):

For the **sqrt** and the
**sqrtl** subroutines, if the value of* x* is negative, a 0 is
returned and the **errno** global variable is set to a **EDOM**
value. A message indicating a **DOMAIN** error is printed on the
standard error output.

These error-handling procedures
may be changed with the **matherr** subroutine when using the
**libmsaa.a** (**-lmsaa**) library.

These subroutines are part of Base Operating System (BOS) Runtime.

The **cbrt** subroutine is
not part of the ANSI C Library.

The **exp**,** expm1**, **log**,
**log10**, **log1p**, or **pow** subroutine.

Subroutines
Overview *AIX 5L Version 5.1 General Programming
Concepts: Writing and Debugging Programs*.

128-Bit long
double Floating-Point Format *AIX 5L Version 5.1 General
Programming Concepts: Writing and Debugging Programs*.
**
**