Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider the possible addition of a method for calculating nth-root by binary search. #11

Open
TheSquidCombatant opened this issue Oct 22, 2023 · 1 comment
Labels
average This may take a few days hard This requires being not only a programmer, but also mathematics

Comments

@TheSquidCombatant
Copy link
Owner

It is possible to calculate the nth-root of a natural number using binary search because the nth-root function is monotonic and continuous.

I remember getting a tiny advantage when calculating the nth-root with binary search. This was in a certain small range of values in the vicinity of the inflection point of the functions of digit-by-digit nth-root extraction and well-known Newton`s method.

It is necessary to check, perhaps on a certain range of input parameters it may be more profitable to calculate the nth-root using a binary search.

P.S.: can only be processed after #10.

@TheSquidCombatant TheSquidCombatant added the hard This requires being not only a programmer, but also mathematics label Oct 22, 2023
@TheSquidCombatant TheSquidCombatant added the average This may take a few days label Nov 5, 2023
@TheSquidCombatant
Copy link
Owner Author

Remember that the number of N digits when raised to the M power cannot give a result greater than N*M digits. A number of N+1 digits when raised to the m power cannot give a result of more than (N+1)*M digits. And so on. This will help greatly reduce the search range for the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
average This may take a few days hard This requires being not only a programmer, but also mathematics
Projects
None yet
Development

No branches or pull requests

1 participant