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

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


  • Subject: Re(2): Stupid newbie question - determine if integer is even or odd
  • From: Jens Bauer <email@hidden>
  • Date: Wed, 14 Aug 2002 01:46:47 +0200

Hi Steve and John,

On Tue, 13 Aug, 2002, Steve Bird <email@hidden> wrote:

>> "These kids today don't know the simple joy of saving four bytes of
>> page-0 memory on a 6502" - unknown

(I do, and I've done it recently; easter-egg in Opera.)

><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) {
>}

Now, using bitwise AND is the correct way.
-The only way that one should use. It's short and fast, furthermore, you don't
run into problems with negaive values.

My vote for (value & 1) !

(Note: I find it kind of annoying that the subject-line sometimes goes
crazy like this:
"Re:_=3D=3FUS-ASCII=3FQ=3FRe:=5F=3D3D=3D3FWINDOWS-
1 252=3D3FQ=3D3FStupid=3D5Fnewbie=3D5
Fque_=3F=3D_stion=5F=3D97=5Fdetermine=5Fi???????Re:_=3D=3FUS-ASCII=3FQ=3F"

Is it some Webmail service that does this, or is it an email client ?
-Who can read that anyway ?)


Love,
Jens

--
Jens Bauer, Faster Software.
-Let's make the World better, shall we ?
_______________________________________________
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(2): Stupid newbie question - determine if integer is even or odd
      • From: Chris Hanson <email@hidden>
References: 
 >Re: Stupid newbie question - determine if integer is even or odd (From: Steve Bird <email@hidden>)

  • Prev by Date: Re: Stupid newbie question - determine if integer is even or odd
  • Next by Date: Re: Stupid_newbie_question_determine_if_integer is even or odd
  • Previous by thread: Re: Stupid newbie question - determine if integer is even or odd
  • Next by thread: Re(2): Stupid newbie question - determine if integer is even or odd
  • Index(es):
    • Date
    • Thread