pow()

This is a discussion on pow() within the C Programming forums, part of the General Programming Boards category; can some one show me an example of the pow() function for linux and windows.. please i cant really understand ...

  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,493
    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, 03:17 AM
  3. trying to use pow()
    By Mikecore in forum C Programming
    Replies: 9
    Last Post: 10-09-2005, 07: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, 12:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21