XCode | Math functions | Header File

Discussion in 'Mac Programming' started by TejasMehrotra, Dec 20, 2009.

  1. TejasMehrotra macrumors newbie

    Joined:
    Dec 14, 2009
    #1
    Hi,

    I am very new to programming on XCode. I was having trouble including functions like pow, sqrt in my program. Which header file am I suppose to include in order to execute my program without any errors?

    Thanks for your help! :)

    Best
    Tejas.
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    #include <math.h>

    In Xcode's documentation window you can search these functions and it will show you which header to include.
     
  3. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #3
    You didn't specify language so I'll throw in one for C++:

    #include <cmath>
     
  4. TejasMehrotra thread starter macrumors newbie

    Joined:
    Dec 14, 2009
    #4
    Thanks a lot!

    It worked. :) Sorry I forgot to mention the language. It was C++.

    Thanks once again. :)
     

Share This Page