Solved

qube root

Posted on 2000-03-03
3
168 Views
Last Modified: 2010-04-10
In C++ how do you use or create the function quberoot?
0
Comment
Question by:jlyle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Author Comment

by:jlyle
ID: 2582038
e-mail jlyle@greco.com
0
 
LVL 22

Accepted Solution

by:
nietod earned 50 total points
ID: 2582232
You can use the pow() function defined in math.h.  pow(x,y )This computes the value of x to the power of y (x^y).

The cube root of something is simply that thing to the power of 1/3 so you just need to use pow(x,1.0/3.0)

Let me know if you have any questions.
0
 
LVL 84

Expert Comment

by:ozo
ID: 2582541
Would you need the function to return an exact value for cbrt(-1000)?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question