• 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
Using math.h
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using math.h


  • Subject: Using math.h
  • From: Nelson Santos <email@hidden>
  • Date: Wed, 14 Mar 2007 10:22:36 -0400

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


  • Follow-Ups:
    • Re: Using math.h
      • From: PGM <email@hidden>
    • Re: Using math.h
      • From: Andy Lee <email@hidden>
    • Re: Using math.h
      • From: Julio Cesar Silva dos Santos <email@hidden>
  • Prev by Date: Re: performclose vs close
  • Next by Date: Re: NSDictionary descriptionWithLocale
  • Previous by thread: Re: NSArrayController, saving and reloading sort descriptors
  • Next by thread: Re: Using math.h
  • Index(es):
    • Date
    • Thread