enow.com Web Search

Search results

  1. Results from the WOW.Com Content Network
  2. c# - Square Root Calculator - Code Review Stack Exchange

    codereview.stackexchange.com/.../78923/square-root-calculator

    4. I have now written a simple square root calculator using the division method: double num, sqrt = 0; int currentDecimal = 0, decimalAccuracyLevel, intAccuracyLevel = 5; do. Console.Write("Enter your number: "); } while (!double.TryParse(Console.ReadLine(), out num)); do. Console.Write("Enter the number of decimal points you wish to be ...

  3. Simple square root calculator - Code Review Stack Exchange

    codereview.stackexchange.com/questions/245586

    Very simple square root calculator. I am sure it's terrible and can be made much better. I feel it's way too many lines. import random ## ask user for a number to find sq root for num1 = input("

  4. Square root approximation with Newton's method

    codereview.stackexchange.com/questions/43456/square-root...

    I designed a program that calculates the square root of a number using Newton's method of approximation that consists of taking a guess (g) and improving it (improved_guess = (x/g + g)/2) until you...

  5. IEEE 754 square root with Newton-Raphson - Code Review Stack...

    codereview.stackexchange.com/questions/229573

    I have an implementation of the sqrt function that uses a combination of IEEE 754, packed bitfields, and the Newton-Raphson algorithm: decompose.h: #ifndef DECOMPOSE_H #define DECOMPOSE_H 1 #ifdef

  6. python - Reduce square root to simplest radical form - Code...

    codereview.stackexchange.com/questions/144041

    The function redsqrt(n) prints out the most reduced form of the square root of n. It calls on another function perfsq(n), which produces a list of perfect squares less than or equal to n. from math import sqrt. def perfsq(n): # Returns list of perfect squares less than or equal to n. l = [1] i, x = 0, 3. while l[-1]+x <= n:

  7. Tonelli-Shanks algorithm implementation of prime modular square...

    codereview.stackexchange.com/questions/43210/tonelli...

    Square Root Calculator. 4. A Blum Blum Shub pseudorandom RNG implementation in JavaScript. 3. SICP ...

  8. Approximating the square root using an iterative method

    codereview.stackexchange.com/questions/48725/approximating...

    Consider epsilon = 1e-6 and performing square_root(1e20) or square_root(1e-20). Better to use a relative__epsilon e.g. fabs(x*x - n) < (epsilon*n) . Even better, given the convergence rate of this algorithm, I believe it converges in about ln2(significand_bits_in_float) (e.g. 5 or 6) iterations. \$\endgroup\$

  9. Computing the integer square root of large numbers

    codereview.stackexchange.com/questions/177923/computing...

    A simple approach is to compute the floating point square root and truncate the result to an integer. In Swift that would be. func isqrt_simple(_ n: Int) -> Int {. return Int(Double(n).squareRoot()) } As observed in , this can produce wrong results for large numbers, because an IEEE 64-bit floating point number with its 53 bit significand ...

  10. c# - Square root implementations - Code Review Stack Exchange

    codereview.stackexchange.com/questions/71596/square-root...

    SquareRoot(int) returns half if the integer is not a perfect square. A very dubious decision. I'd consider returning a best integer approximation, or throwing an exception. uses a linear search. A binary search would be quite faster. A Newton-Raphson (yes it works with integers) would be even factor.

  11. beginner - Calculator (Java) - Code Review Stack Exchange

    codereview.stackexchange.com/questions/159542/calculator-java

    5. I am a beginner learning Java and this is a calculator program I've made. I'm looking for suggestions to improve it and things I could've done better. I don't know OOP principles much, so any and all suggestions are welcome. import java.util.Scanner; public class BasicCalci {. Scanner sc = new Scanner(System.in); int x = 0;