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

alc6379 120 Cookie... That's it Team Colleague

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.

m-soft 0 Junior Poster in Training

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:

Dave Sinkula 2,398 long time no c Team Colleague

vegaseat 1,735 DaniWeb's Hypocrite Team Colleague

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!

m-soft 0 Junior Poster in Training

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

Narue 5,707 Bad Cop Team Colleague

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.

vegaseat 1,735 DaniWeb's Hypocrite Team Colleague

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.