• 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: Stupid newbie question - determine if integer is even or odd
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stupid newbie question - determine if integer is even or odd


  • Subject: Re: Stupid newbie question - determine if integer is even or odd
  • From: Heather Donahue <email@hidden>
  • Date: Tue, 13 Aug 2002 17:17:43 -0700

On 8/13/02 4:28 PM, "Steve Bird" <email@hidden> wrote:

> <Obsessed cycle-counter>
> I'd just like to point out that even though everyone else who answered
> this question did a mod , I did not see a single answer of
> if (myVal & 0x1) {
> }
>
> --- ANDing is most often faster than division. It pains me to see a
> division whose result (quotient) is discarded. That's just cruel. There
> IS such a thing as the Society for the Prevention of Cruelty to Computers,
> you know.

Maybe I'm being pedantic, and possibly even wrong, but doesn't the ANDing
method assume you know the internal bitwise representation of the variable?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Stupid newbie question - determine if integer is even or odd
      • From: "Clark S. Cox III" <email@hidden>
    • Re: Stupid newbie question - determine if integer is even or odd
      • From: "John C. Randolph" <email@hidden>
References: 
 >Re: Stupid newbie question - determine if integer is even or odd (From: Steve Bird <email@hidden>)

  • Prev by Date: [TRTFM] mouseMove invoked on non-FrstResponder?
  • Next by Date: Re: Stupid newbie question - determine if integer is even or odd
  • Previous by thread: Re: Re(2): Stupid newbie question - determine if integer is even or odd
  • Next by thread: Re: Stupid newbie question - determine if integer is even or odd
  • Index(es):
    • Date
    • Thread