SQRT(3) BSD Library Functions Manual SQRT(3)NAME
sqrt -- square root function
SYNOPSIS
#include <math.h>
double
sqrt(double x);
long double
sqrtl(long double x);
float
sqrtf(float 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.
VECTOR OPERATIONS
If you need to apply the sqrt() function to SIMD vectors or arrays, using the following functions provided by the Accelerate.framework may
give significantly better performance:
#include <Accelerate/Accelerate.h>
vFloat vsqrtf(vFloat x);
vFloat vrsqrtf(vFloat x);
void vvsqrtf(float *y, const float *x, const int *n);
void vvsqrt(double *y, const double *x, const int *n);
void vvrsqrtf(float *y, const float *x, const int *n);
void vvrsqrt(double *y, const double *x, const int *n);
SEE ALSO math(3)STANDARDS
The sqrt() function conforms to ISO/IEC 9899:2011.
BSD December 11, 2006 BSD
Check Out this Related Man Page
SIN(3) BSD Library Functions Manual SIN(3)NAME
sin -- sine function
SYNOPSIS
#include <math.h>
double
sin(double x);
long double
sinl(long double x);
float
sinf(float x);
DESCRIPTION
The sin() function computes the sine of x (measured in radians).
SPECIAL VALUES
sin(+-0) returns +-0.
sin(+-infinity) returns a NaN and raises the "invalid" floating-point exception.
VECTOR OPERATIONS
If you need to apply the sin() function to SIMD vectors or arrays, using the following functions provided by the Accelerate.framework may
give significantly better performance:
#include <Accelerate/Accelerate.h>
vFloat vsinf(vFloat x);
vFloat vsincosf(vFloat x, vFloat *c);
void vvsinf(float *y, const float *x, const int *n);
void vvsin(double *y, const double *x, const int *n);
void vvsincosf(float *s, float *c, const float *x, const int *n);
void vvsincos(double *s, double *c, const double *x, const int *n);
SEE ALSO acos(3), asin(3), atan(3), atan2(3), cos(3), cosh(3), sinh(3), tan(3), tanh(3), math(3)STANDARDS
The sin() function conforms to ISO/IEC 9899:2011.
BSD December 11, 2006 BSD
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... (1 Reply)
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... (2 Replies)
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=... (7 Replies)
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: ( (... (6 Replies)
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... (2 Replies)
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? (5 Replies)
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... (3 Replies)