Top "Sqrt" questions

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

Hardware implementation of square root?

I'm trying to find a little bit more information for efficient square root algorithms which are most likely implemented on …

math hardware sqrt
c++ practical computational complexity of <cmath> SQRT()

What is the difference in CPU cycles (or, in essence, in 'speed') between x /= y; and #include <cmath> …

c++ complexity-theory sqrt cpu-cycles cpu-time
Difference between **(1/2), math.sqrt and cmath.sqrt?

What is the difference between x**(1/2) , math.sqrt() and cmath.sqrt()? Why does cmath.sqrt() get complex roots of a …

python math square-root sqrt
Using fractional exponent with bc

bc, a Linux command-line calculator, is proficient enough to calculate 3^2 9 Even a negative exponent doesn't confuse it: 3^-2 0.11111 Yet it …

exponent sqrt bc
Square root of a negative array Python

I know that Python has the cmath module to find the square root of negative numbers. What I would like …

python arrays sqrt cmath
What should I do when 'more than one instance of overloaded function "sqrt" matches the argument list'?

I get an error in my code in the for loop, for ( j = 3; j <=sqrt(num); j +=2): more than …

c++ overloading sqrt
sqrt function on stm32 arm doesn't work

I'm using an stm32f4 chip (cortex-m4) with an FPU and sqrt( 9.7 * 9.7 ) returns 94.17.. i am using the arm-none-eabi-gcc compiler and …

math arm sqrt fpu cortex-m
Generating digits of square root of 2

I want to generate the digits of the square root of two to 3 million digits. I am aware of Newton-Raphson …

python algorithm numerical-methods sqrt
I don't understand number conversions in Haskell

Here is what I'm trying to do: isPrime :: Int -> Bool isPrime x = all (\y -> x `mod` …

haskell sqrt
Is it possible to write Quake's fast InvSqrt() function in Rust?

This is just to satisfy my own curiosity. Is there an implementation of this: float InvSqrt (float x) { float xhalf = 0.5…

rust floating-point sqrt type-punning