sqrt Questions

1

Solved

I'm working on an application for solving quadratic constraints in 2D Euclidean geometry involving circles and lines (Constructable Numbers) and representing the results graphically. I've found thi...
Oruro asked 7/1, 2013 at 3:47

4

Solved

Under visual 2012 how can I call the sqrtsd asm function in a c++ project I can't find it via google something like : double mySqrt(double val) { __asm { ... sqrstd... } } EDIT: in 32bit mo...
Embry asked 28/12, 2012 at 9:20

3

Solved

I am looking for a fast square root implementation in Java for double values in the input range of [0, 2*10^12]. For any value in this range, the precision should be upto 5 decimal places. In other...
Yankeeism asked 7/11, 2012 at 5:57

4

Solved

I am programming in the c language on mac os x. I am using sqrt, from math.h, function like this: int start = Data -> start_number; double localSum; for (start; start <= end; start++) { lo...
Pandora asked 1/11, 2012 at 13:58

3

Solved

I am just learning C++. Compiling with g++ version 3.2.3, "g++ hworld.cpp": double sqrt(double); int main(){ double x = sqrt(1515.15); return 0; } That compiles fine, but if we were to replace...
Injustice asked 17/9, 2012 at 4:19

2

Solved

I have the code unsigned long long f(unsigned long long x, unsigned long long y){ return sqrt( ( (5*x*x + 1) * (5*y*y +1) - 1 ) / 4 ); } but if x or y is too big, the thing overflows even thou...
Congdon asked 26/6, 2012 at 20:37

4

Solved

I have a call to long long a = sqrt(n/2); Both a and n are long long's but it won't let me compile because it says my use of sqrt() is an ambiguous call. I don't see how it's possibly ambiguous ...
Scofield asked 10/6, 2012 at 16:11

2

Solved

I'm just learning haskell (on my own, for fun) and I've come up against a wall. My Question: How can I define a function flrt = (floor . sqrt) When I try it in a file and compile, GCHi compla...
Banas asked 2/6, 2012 at 14:32

2

Solved

I'm using sqrt() function from math library, when I build for 64 bit using -m64 I'm getting correct result but when I build for 32 bit I have very inconsistent behaviour. For example on 64bit do...
Gotha asked 30/5, 2012 at 0:38

3

Solved

I am using Code Block with GNU GCC Compiler. And I am trying this code int number,temp; printf("Enter a number :"); scanf("%d",&number); temp = sqrt(number); printf("\n%d",sqrt(number)); //pr...
Goldofpleasure asked 30/4, 2012 at 10:36

4

Solved

I have a control loop running at high frequency and need to compute a square root each cycle. Typical square root functions work fine but take excessive time. Since the value I'm taking the square ...
Desexualize asked 12/4, 2012 at 14:10

2

Solved

I'm trying to find a little bit more information for efficient square root algorithms which are most likely implemented on FPGA. A lot of algorithms are found already but which one are for example ...
Sharpen asked 15/1, 2012 at 17:1

4

Solved

I am using Anthony Williams' fixed point library described in the Dr Dobb's article "Optimizing Math-Intensive Applications with Fixed-Point Arithmetic" to calculate the distance between two geogra...
Conventionality asked 4/1, 2012 at 1:38

1

Solved

(EDIT: Let's title this, "Lessons in how measurements can go wrong." I still haven't figured out exactly what's causing the discrepancy though.) I found a very fast integer square root function he...
Amperehour asked 22/11, 2011 at 2:34

4

Solved

Consider this code: double result = Math.Sqrt(4746073226998689451); For result I get 2178548422 instead of 2178548421.999999854etc... How can I get more precise result?
Alanalana asked 13/11, 2011 at 18:23

4

Solved

How do you take the square root of a negative number in C++?I know it should return a real and a complex part, I get a NaN?How do I take the real part?
Bravo asked 12/8, 2011 at 15:49

9

Solved

I want to generate the digits of the square root of two to 3 million digits. I am aware of Newton-Raphson but I don't have much clue how to implement it in C or C++ due to lack of biginteger suppo...
Slippy asked 3/3, 2011 at 22:56

2

Solved

Here is what I'm trying to do: isPrime :: Int -> Bool isPrime x = all (\y -> x `mod` y /= 0) [3, 5..floor(sqrt x)] (I know I'm not checking for division by two--please ignore that.) Here's...
Brennen asked 9/8, 2011 at 19:54

3

Solved

What is the difference in CPU cycles (or, in essence, in 'speed') between x /= y; and #include <cmath> x = sqrt(y); EDIT: I know the operations aren't equivalent, I'm just arbitrari...
Shaver asked 30/7, 2011 at 16:9

3

Solved

How can I get sqrt from Int. I try so: sqrt . fromInteger x But get error with types compatibility.
Mariken asked 14/7, 2011 at 14:55

2

Solved

My code is as follows: #include <cmath> #include <iostream> float foo(float f) { std::cout << "float\n"; return f; } double foo(double d) { std::cout << "double\n"; re...
Wraith asked 19/5, 2011 at 9:12

6

Solved

In specific: Im doing some math operations, and the application keeps crashing because a double that is widely used happens to get the value: -1.#IND000000000000 when "some" numbers are sqrt'ed......
Sinistrocular asked 14/1, 2011 at 6:12

12

Solved

Most programming languages give 2 as the answer to square root of 4. However, there are two answers: 2 and -2. Is there any particular reason, historical or otherwise, why only one answer is usuall...

6

Solved

Why is the output of sqrt not an integer for "16" in PHP? Example php > $fig = 16; php > $sq = sqrt($fig); //should be 4 php > echo $sq; 4 php > echo is_int($sq); // should give 1, bu...
Dorladorlisa asked 31/10, 2009 at 14:18

© 2022 - 2024 — McMap. All rights reserved.