Using math.h
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