Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cbrt(3) — OSF/1 SILVER Baselevel 4 rev36

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exp(3)

isnan(3)

sqrt(3)  —  Subroutines

Digital

NAME

sqrt, cbrt − Computes square root and cube root functions

LIBRARY

Math Library (libm.a)

SYNOPSIS

#include <math.h> double sqrt (
double x); double cbrt (
double x);

PARAMETERS

xSpecifies some double value. 

DESCRIPTION

The sqrt() and cbrt() functions compute the square root and cube root, respectively, of their parameters. 

NOTES

AES Support Level: Full use (sqrt())

ERROR (due to roundoff etc.):

       •The cbrt() function is accurate to within 0.7 ulps. 

       •The sqrt() function on MIPS machines conforms to IEEE 754 and is correctly rounded in accordance with the rounding mode in force; the error is less than half an ulp in the default mode (round−to−nearest).  An ulp is one Unit in the Last Place carried. 

RETURN VALUES

The sqrt() function returns the square root of x. The value of x must be positive.  If x is NaN, NaN is returned.  Otherwise, NaN is returned and errno is set to indicate the error. 

The cbrt() function returns the cube root of x. 

ERRORS

If the sqrt() function fails, errno may be set to the following value:

[EDOM]The value of the x parameter is negative. 

ENVIRONMENT

In the SVID-2 habitat, the cbrt() function is not available.  Furthermore, when x is negative, the sqrt() function returns zero, sets errno to EDOM, and prints a message indicating DOMAIN error on the standard error output.  These error-handling procedures can be changed with the matherr() function. 

RELATED INFORMATION

Functions: exp(3), isnan(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026