Skip to content

Instantly share code, notes, and snippets.

@0V
Last active May 19, 2017 02:46
Show Gist options
  • Save 0V/e2dcd132d930b982927bd767f20a5540 to your computer and use it in GitHub Desktop.
Save 0V/e2dcd132d930b982927bd767f20a5540 to your computer and use it in GitHub Desktop.
1 * 2 = √√ * 2 = √√ * 2 = ... ; g++ root3.cpp -lm -std=c++11
#include <cmath>
#include <iostream>
#include <iomanip>
#include <limits>
double excute(){
double tmp = 1;
double current = 1;
while(1){
current *= 2;
current = std::sqrt(std::sqrt(current));
if(tmp == current) return current;
tmp = current;
}
}
int main(){
std::cout << std::setprecision(std::numeric_limits<double>::max_digits10)
<< excute() << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment