Questions tagged [sqrt]

The `sqrt` function returns the positive square root of a number in several programming languages.

programming language:
The sqrt(), sqrtf() and sqrtl() functions return the nonnegative square root of x. With the GCC compiler they resid in the math library (libm), which is linked using -lm. They can be found in the <math.h> header.

programming language:
The std::sqrt() function returns the nonnegative square root of x. It can be found in the <cmath> header.

:
A built-in function, can (and should) be used in a vectorived manner on numerc matrices.
Handles negative and complex numbers as well.
See official doc for more details.

:
Return the positive square-root of an array, element-wise.
See doc for more details.

:
Returns the correctly rounded positive square root of a double value.
See the java.lang.Math class for more details.

408 questions
-5
votes
2 answers

For loop with a range in function

Write a function called printsquares(numin) i.e., takes in the parameter numin. The numin becomes the upper end of a for loop with a range Thus: for i in range(numin) and as the for loop executes it prints the square of each i in the range. …
mb13
  • 33
  • 4
-6
votes
2 answers

How find square root n by computing the next Xi term on javascript

Write the function sqrt(A) for computing square root of positive real numbers using next numerical method xi+1 = (1/2) * (xi +(A/xi)). Where the A - input rial number; On zero iteration next statements have been taken: x0 = A; The error should be at…
-9
votes
1 answer

How to write and implement your own function

I need to write my own sqrt function: double my_sqrt_1(double n) How would I go about doing this? At first I tried putting this outside of "int main()": double my_sqrt_1(double n) { int x = 1; x = (x + n / x) / 2; } I then put this: int…
Joe
  • 95
  • 1
  • 1
  • 7
1 2 3
27
28