A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/dc/d9c/babylonian__method_8cpp_source.html below:

TheAlgorithms/C++: numerical_methods/babylonian_method.cpp Source File

Go to the documentation of this file. 33 while

(i * i <= radicand) {

41

(radicand / x0 + x0) / 2;

44 while

(std::max(x0, x1) - std::min(x0, x1) < 0.0001) {

45

temp = (radicand / x1 + x1) / 2;

65 auto

testcase1 = 125348;

66 auto

testcase2 = 752080;

68 auto

real_output1 = 354.045194855;

69 auto

real_output2 = 867.225460881;

76

assert(std::max(test_result1, real_output1) -

77

std::min(test_result1, real_output1) <

80

assert(std::max(test_result2, real_output2) -

81

std::min(test_result2, real_output2) <

85

std::cout <<

"All tests have successfully passed!\n"

;

static void test()

Self-test implementations.

int main()

Main function calls automated test function to test the working of fast fourier transform.

double babylonian_method(double radicand)

Babylonian methods is an iterative function which returns square root of radicand.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4