what is the power command in c..

This is a discussion on what is the power command in c.. within the C Programming forums, part of the General Programming Boards category; i thought 10^2 in c equals 100 it gives me something else how to do power...

  1. #1
    Banned
    Join Date
    Oct 2008
    Posts
    1,535

    what is the power command in c..

    i thought 10^2 in c equals 100

    it gives me something else

    how to do power

  2. #2
    Registered User
    Join Date
    Sep 2008
    Posts
    27
    well can you use the math.h library which has the function pow(x,y) where
    x^y in mathematical terms.

    edit: I'm not quite sure what ^ does, I know it doesn't do exponentials but if someone could clarify it would be great

  3. #3
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    398
    You are correct about the pow function.

    And as for ^, it is a bitwise XOR.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by transgalactic2 View Post
    i thought 10^2 in c equals 100

    it gives me something else

    how to do power
    Yes, it would give you 8, as 10 XOR 2 is 8.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem With My Box
    By HaVoX in forum Tech Board
    Replies: 9
    Last Post: 10-15-2005, 08:38 AM
  2. No Power, but power being supplied.
    By jrahhali in forum Tech Board
    Replies: 6
    Last Post: 08-11-2005, 03:50 AM
  3. The destructive power of a nuclear bomb
    By InvariantLoop in forum A Brief History of Cprogramming.com
    Replies: 30
    Last Post: 03-24-2005, 02:46 AM
  4. Power supplies and demanding processors
    By Liger86 in forum Tech Board
    Replies: 12
    Last Post: 03-17-2005, 11:56 AM

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