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/d2/d0b/fast__power_8cpp_source.html below:

TheAlgorithms/C++: math/fast_power.cpp Source File

Go to the documentation of this file. 39

result = bottom * bottom;

41

result = bottom * bottom * a;

69

std::srand(std::time(

nullptr

));

70

std::ios_base::sync_with_stdio(

false

);

72

std::cout <<

"Testing..."

<< std::endl;

73 for

(

int

i = 0; i < 20; i++) {

74 int

a = std::rand() % 20 - 10;

75 int

b = std::rand() % 20 - 10;

76

std::cout << std::endl <<

"Calculating "

<< a <<

"^"

<< b << std::endl;

80

std::cout <<

"------ "

<< a <<

"^"

<< b <<

" = "

double fast_power_linear(T a, T b)

double fast_power_recursive(T a, T b)


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