Simple square root calculator - Code Review Stack Exchange 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( quot;
beginner - Calculator (Java) - Code Review Stack Exchange The calculator has no knowledge of how to subtract beyond it containing this Function It's all encapsulated and doesn't leak into any other class's responsibility So you've created your SubtractFunction, AddFunction, MultiplyFunction etc etc, where are we going to put them? The calculator needs to store them, say in some kind of list:
Square root approximation with Newtons method 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
Computing the integer square root of large numbers The "integer square root" of a non-negative integer \$ n \$ is defined as the largest integer not greater than \$ \sqrt{n} \$: $$ \operatorname{isqrt}(n) = \lfloor \sqrt{n} \rfloor = \max \{ k \in \Bbb N_0 \mid k^2 \le n \} $$ It is for example needed in prime factorization, as an upper bound for the possible factors