Hello

I have a number from maximum 255 digits. I must compute the cube root of this number with 10 decimals.
Time of execution is 1 second

Could you help me ?

10x

Have you written any code yourself to acheive this aim?

Usually, we like to see if we can't help you troubleshoot your logic, or your syntax, rather than give you a shove in the particular direction.

Have you written any code yourself to acheive this aim?

Usually, we like to see if we can't help you troubleshoot your logic, or your syntax, rather than give you a shove in the particular direction.

I have'n write any code. I have no ideea how to write it. Sorry :cry:

Man, this gets my rusty brain working.

exp(1/3*(ln(x))) gives you the cuberoot of x

ln(x) can be found to the nth degree of accuracy via binary expansion and exp() via continued fraction expansion. This is a hint, go at it tiger!

Man, this gets my rusty brain working.

exp(1/3*(ln(x))) gives you the cuberoot of x

ln(x) can be found to the nth degree of accuracy via binary expansion and exp() via continued fraction expansion. This is a hint, go at it tiger!

ln(x) doesn't work in BC 3.1 and what type shold have x because my number can have 255 digits.

Thanks

>ln(x) doesn't work in BC 3.1
Neither does 1/3. Maybe, just maybe vegaseat was using mathematical notation rather than valid C++ code. :rolleyes: Get a reference and figure out what the equivalent functions are. It's really not that difficult.

Sorry, exp(1/3*(ln(x))) is math notation in textform.

Many compilers have log(x) for the natural logarithm and log10(x) for base 10 logarithms. How to do "one third" I leave to your genius!

A hint: long double is commonly 80 bits

This article has been dead for over six months. Start a new discussion instead.