Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

How can I obtain the cube root in C++?

I know how to obtain the square root of a number using the sqrt function.

How can I obtain the cube root of a number?

Answer*

Cancel
3
  • re; "and is almost as accurate β€” the maximum error is about 1 ULP" please add assume readers know nothing and add a comment what ULP is. Ultimate Lip Pucker is probably wrong :) Commented Aug 7 at 15:01
  • ULP β€” Unit of Last Position. That is, this is an expression of the error in units of the least significant binary digit of the mantissa. It is convenient to use for numbers presented in exponential format (including float and double), and is essentially similar to the relative error. For example, correctly rounded values have an error of no more than 0.5 ULP. Commented Aug 7 at 15:46
  • 1
    Thank you! I really love this answer πŸ‘ Commented Aug 8 at 12:14