# sqrt(3) [opendarwin man page]

```SQRT(3) 						   BSD Library Functions Manual 						   SQRT(3)

NAME
sqrt -- square root function

SYNOPSIS
#include <math.h>

double
sqrt(double x);

DESCRIPTION
The sqrt() function compute the non-negative square root of x.

SPECIAL VALUES
sqrt(-0) returns -0.

sqrt(x) returns a NaN and generates a domain error for x < 0.

math(3), matherr(3)

STANDARDS
The sqrt() function conforms to ISO/IEC 9899:1999(E).

BSD								 January 27, 2003							       BSD```

## Check Out this Related Man Page

```SQRT(3) 						   BSD Library Functions Manual 						   SQRT(3)

NAME
cbrt, cbrtf, cbrtl, sqrt, sqrtf, sqrtl -- cube root and square root functions

LIBRARY
Math Library (libm, -lm)

SYNOPSIS
#include <math.h>

double
cbrt(double x);

float
cbrtf(float x);

long double
cbrtl(long double x);

double
sqrt(double x);

float
sqrtf(float x);

long double
sqrtl(long double x);

DESCRIPTION
The cbrt(), cbrtf(), and cbrtl() functions compute the cube root of x.

The sqrt(), sqrtf(), and sqrtl() functions compute the non-negative square root of x.

RETURN VALUES
The cbrt(), cbrtf(), and cbrtl() functions return the requested cube root.  The sqrt(), sqrtf(), and sqrtl() functions return the requested
square root unless an error occurs.  An attempt to take the sqrt() of negative x raises an invalid exception and causes an NaN to be returned
(except that the square root of -0 is valid and equal to -0.)

fenv(3), math(3)

STANDARDS
The cbrt(), cbrtf(), cbrtl(), sqrt(), sqrtf(), and sqrtl() functions conform to ISO/IEC 9899:1999 (``ISO C99'').

HISTORY
The cbrt() function appeared in 4.3BSD.  The sqrtl() function appeared in FreeBSD 8.0.  The cbrtl() function appeared in FreeBSD 9.0.

BSD								   March 5, 2011							       BSD```
Man Page

## sqrt

Hi! when i'm trying to compile this lite example on my linux machine I'll get errors and i don't know why.. #include <stdio.h> #include <math.h> /* needed by sqrt() */ int main() { printf("%f", sqrt(10.0)); return (0); } this is the error: /tmp/cc33hNVHK.o: In function...

## sqrt is not find???

I was writing a simple program in linux, which includes sqrt function of c. I included the math.h. But when I use gcc to compile it, it gave an error message: /home/murat/tmp/ccOv9upo.o(.text+0x4b): In function `main': : undefined reference to `sqrt' collect2: ld returned 1 exit status I...

## How to create SQRT function in catenate file

HI, I have a file which i catenate and using the fields in the file, I would like to get sqrt of it. I tried to man the function but it normally would need an echo as well as bc. What I am intending to find out is catenate a file where let say cat a.txt| awk ' { t= h*(\$3+\$2); t=...

## how can i find sqrt of a any number without using expr

hi friends can any body tell me how can i find sqrt of a any given number without using expr in bash shell while i am doing i got some errors please take a look and code is here x=\$((( ( sqrt(\$1) ) | bc ))) echo \$x \$ sh quadratic-eqn-roots.sh 9 quadratic-eqn-roots.sh: line 12: ( (...

## C Library reference error using sqrt() - will not compile.

This so basic that it should work.... Any ideas would be appreciared. Using a number directly in the sqrt allows it to compile. primrose > cat a.c #include <stdio.h> #include <math.h> int main(void) { double abcd=9; printf("%f\n",sqrt(abcd)); } primrose > gcc a.c Undefined first...

## sqrt in bash

Hi, i have a the following script: #!/bin/bash a=3 b=9 let "c= b*a" let "d=sqrt \$c " echo \$d But when i execute the code, it gives me the an error saying: line 5: let: d=sqrt 27 : syntax error in expression (error token is "27 ") Can any body tell me what I'm doing wrong?

## Q: Is SQRT(n) possible in a POSIX compliant shell? A: Yes within limits.

Hi all... This is just a fun project to see if it is possible to get a square root of a positive integer from 1 to 9200000 to 6 decimal places on a 64 bit architecture machine. It is coded around dash and the results show the values from 0 to 10000. Complex numbers can easily be catered for by...