Questions tagged [square-root]

A square root of a number A is a number y such that y^2 = A, or, in other words, a number y whose square (the result of multiplying the number by itself, or y × y) is A.

A square root of a number A is a number y such that y2 = a, or, in other words, a number y whose square (the result of multiplying the number by itself, or y × y) is A.

398 questions
-4
votes
2 answers

SquareRoot using recursive

I hate Recursive right now. Any way does any one know how to find square root using recursive solution on python. Or at least break it down to simple problems. All examples I found are linear only using one argument in the function. My function…
user3597291
  • 9
  • 1
  • 1
-4
votes
1 answer

Square root program in C without using sqrt function

I am trying to make a program in C to find the approximate square root of a number using the formula NG = 0.5( LG + N/ LG). So far i have: #include #include int main(){ double n; double LG=1; double NG; …
user3221816
  • 135
  • 2
  • 2
  • 10
-4
votes
1 answer

how would I convert the sqrt(x2 − x1)^2 (y2 − y1)^2 to proper java code

How would I convert the equation for the distance between two points: sqrt((x2 − x1)^2 + (y2 − y1)^2) into proper Java code?
-5
votes
2 answers

Formula to find square root of a natural number using only addition and subtraction

How to use only addition and subtraction to find out square root of a natural number? Thanks. [I have looked over the internet but i didn't find any content related to this problem.] Explanation to my problem: I want to create a c function which…
-5
votes
2 answers

write code to find square-root using bisection method in c++?

Bisection is as far as i know narrowing your search and reach the specific value in interval. please give me a sample of that how to make a generic code to find square-root. the way i think is taking three variables low, mid, high. high = userinput,…
Jhon Smith
  • 21
  • 1
  • 1
  • 2
-6
votes
2 answers

How to perform square root operation?

I would like to calculate distance from origin for some points. I don't know how to do that in Javascript. If x and y are the co-ordinates of a point distanceFromOrigin=sqrt(x^2 + y^2). So far, below is the code I could get running in…
srk
  • 427
  • 4
  • 11
  • 27
-6
votes
5 answers

Program that solves a simple math equation

I'm having trouble understanding the syntax of Java and how to use Java to solve math equations. Below is just an example of a simple equation. I want the program to simply be able to output the result of the calculation. If anyone can help I would…
user2499376
  • 59
  • 1
  • 3
-6
votes
4 answers

Square root of number python

Here's my code: import cmath root = (cmath.sqrt(25)) print (root) raw_input() The problem i face is the result of root is 5+0j which is undesirable i only want the square root. How can i fix this?
user2151341
  • 47
  • 2
  • 3
  • 5
1 2 3
26
27