Re: Math question
Re: Math question
- Subject: Re: Math question
- From: Peter Ammon <email@hidden>
- Date: Sat, 1 Sep 2001 20:19:48 -0400
On Saturday, September 1, 2001, at 07:27 PM, John C. Randolph wrote:
On Saturday, September 1, 2001, at 02:34 PM, email@hidden wrote:
Hello all. i have a question about math in Cocoa. how do i do higher
level math? obviously i can do the basics */+-% without problem. but
what about doing things like raising a number to a power?
fooSquared = foo^2;
In C, ^ is the bitwise xor operator, not an exponentiation operator.
pow is the standard way to raise floating-point values to powers;
there's no standard way to do it with integers (though it would be easy
enough to write one).
[snip]
-Peter (hoping he didn't just fall for something)