Thread: what is the power command in c..

  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
    404
    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, 07:38 AM
  2. No Power, but power being supplied.
    By jrahhali in forum Tech Board
    Replies: 6
    Last Post: 08-11-2005, 02: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