• 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: Math question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Math question


  • Subject: Re: Math question
  • From: "John C. Randolph" <email@hidden>
  • Date: Sat, 1 Sep 2001 19:42:26 -0700

On Saturday, September 1, 2001, at 05:19 PM, Peter Ammon wrote:

On Saturday, September 1, 2001, at 07:27 PM, John C. Randolph wrote:
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)

Yeah, that's the ticket! I was just trying to see if anyone was paying attention! Sure, that's what I was doing!

That's a bit of an embarassing slip, considering that just a few weeks ago I had occasion to use:

void *a, *b;
...
a ^= b;
b ^= a;
a ^= b;

-jcr

"This is not a book to be tossed aside lightly. Rather, it should be hurled with great force." -Dorothy Parker


References: 
 >Re: Math question (From: Peter Ammon <email@hidden>)

  • Prev by Date: Re: Math question
  • Next by Date: The unquittable App
  • Previous by thread: Re: Math question
  • Next by thread: Re: Math question
  • Index(es):
    • Date
    • Thread