I need to find the cube root of a huge(5k bits or so) number rounded upwards. How do I do that?
If GNU bc is fine for you, this might do:
It essentially boils down to:
You will need to increase the scale variable in order to have the necessary precision:
As you probably noticed, without increasing the scale variable (on my system it defaults to 20) the result has nowhere near your required precision.
The same technique can be applied to cube roots: set n = 3 and iterate until you achieve the desired precision.
In the case of the specification in the comment "it needs to be rounded up to closest integer and be exact", that will only be possible for numbers that have integer or rational cube roots. That said, you can use the cited algorithm to find an answer to this level of precision by iterating until the difference between the result of one iteration and the next is less than 0.5. That is close enough to assure that future iterations won't wander far from that approximation.
Is this an exercise for a numerical analysis class? If so, I suspect this is exactly why the question was posed this way: the instructor would like you to apply the general rule to the specific problem.