• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using math.h
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using math.h


  • Subject: Re: Using math.h
  • From: Julio Cesar Silva dos Santos <email@hidden>
  • Date: Wed, 14 Mar 2007 11:36:16 -0300

Try #include, not #import:

#include <math.h>

It is also available in CoreServices Framework (Don't forget to add the framework to the project):

#import <CoreServices/CoreServices.h>

Julio Cesar Silva dos Santos
email@hidden
Skype: jcssantos01
Blogjective-C
http://www.jcs.santos.nom.br/wp
FetchYourLyrics
http://www.jcs.santos.nom.br/fyl/fyl.html


On 14/03/2007, at 11:22, Nelson Santos wrote:

Hi all,

I am writing a Cocoa app, and for one of my methods, I'd like to use exponential math. For example, I want to raise 10 to the power of 3 and store the result. I found the pow() function in math.h, and read the docs in the man page. So, in my code, I have something like:

double a = 10;
double b = 3;
double c = pow(a, b);

But when compiling my app, I get a compile error "called object 'pow' is not a function".

I've added #import <math.h> to the top of my .m file. But still nothing.

How do I get pow() and the other math functions to work in my Cocoa app?

Thanks.
Nelson
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Using math.h (From: Nelson Santos <email@hidden>)

  • Prev by Date: Re: performclose vs close
  • Next by Date: Re: Using math.h
  • Previous by thread: Using math.h
  • Next by thread: Re: Using math.h
  • Index(es):
    • Date
    • Thread