Thread: pow()

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    227

    Talking pow()

    can some one show me an example of the pow() function for linux and windows.. please i cant really understand it in the man page.. thanx

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    double pow(double x, double y);

    it raises x to the y power

    pow(2,10) == 1024.0
    pow(2,0) == 1.0
    pow(10,2) - 100.0 < 0.00001


    the last one shows the problems of comparing floats.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    227

    Wink

    ok but how would i enter that in to a code... that is what i mean.. sorry but i learn by example.. i know to know how the code is inputed so i know how to work with it.. thanx hope you understand

  4. #4
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    Originally posted by xlordt
    ok but how would i enter that in to a code... that is what i mean.. sorry but i learn by example.. i know to know how the code is inputed so i know how to work with it.. thanx hope you understand
    Code:
    #include <math.h>
    
    int main(void)
    {
       double p;
       p = pow(10, 2);
       printf("pow(10,2) = %f\n", p);
       return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's the difference between pow() vs shift?
    By Overworked_PhD in forum C Programming
    Replies: 9
    Last Post: 01-06-2008, 01:04 PM
  2. Help with pow()
    By jedi_jinn in forum C Programming
    Replies: 7
    Last Post: 10-09-2006, 02:17 AM
  3. trying to use pow()
    By Mikecore in forum C Programming
    Replies: 9
    Last Post: 10-09-2005, 06:30 PM
  4. pow function returns wrong value
    By ckbales in forum C Programming
    Replies: 5
    Last Post: 02-01-2003, 09:46 PM
  5. Problem with pow()
    By RMacFly in forum C Programming
    Replies: 4
    Last Post: 09-18-2001, 11:54 AM