Thread: Cube root

  1. #1
    gahhhhh
    Guest

    Cube root

    What function can i use to get the cube root of a number?
    -ty

  2. #2
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    you can use pow and pass one third as the power parameter. I don't use the standard libraries much so there might be a function devoted to it, but for now you can use that.

  3. #3
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511

    Wink

    As far as I know there is no power function in C++. There is one in Java however.
    Mr. C: Author and Instructor

  4. #4
    Evil Sock Puppet MadHatter's Avatar
    Join Date
    Nov 2002
    Posts
    176
    there is a pow() in the cmath header.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    the power function in c++ is pow(double x, double y) in cmath where x is the base and y is the exponent

    edit::MadHatter beat me...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer confusion
    By Blackroot in forum C++ Programming
    Replies: 11
    Last Post: 09-12-2007, 12:44 AM
  2. A cube root program.
    By guest111 in forum C Programming
    Replies: 14
    Last Post: 04-27-2007, 09:37 PM
  3. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 09:10 AM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Templated Binary Tree... dear god...
    By Nakeerb in forum C++ Programming
    Replies: 15
    Last Post: 01-17-2003, 02:24 AM