A program built in cpp for testing different algorithms for finding the square root of large numbers. Made for the optimisation sidequest.
A program built in cpp for testing different algorithms for finding the square root of large numbers. Made for the optimisation sidequest.
I was able to add FTXUI to the project, I had some issues since I have never used it before and I am still pretty new to development in C++. I added text boxes for each root finding method and a progress bar for the one that was currently running. Next I will either make it look better, try to add some inputs with ftxui like allowing you to decide what method to run and deciding settings in the program. Or I will implement another root finding method.
Log in to leave a comment
I have added three methods of finding the square root.
n1: The sqrt() function. I tried to find information about how it works but I’m not sure, but I thought I would include it so that I can compare my own methods with it.
n2: Integer testing, this method basically tries if an int to the power of two is bigger than the target number. And if so return that int, it isn’t very accurate but it’s fast.
n3: Integer testing for each number position. Does the same thing as number 2 but first guesses for the million number, then the hundred thousand number, then the ten thousand number, and so on until it gets 3 decimals of accuracy. A lot more precise than the second method and less looping for big numbers.
I also added a loading bar, ascii title, and an output for each method and now I’m gonna try to add FTXUI to make it look a lot prettier.
Log in to leave a comment
Hello world! This time was spent setting up everything so that I could actually run the program. I will now start working on the actual program.
Log in to leave a comment