• 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: "John C. Randolph" <email@hidden>
  • Date: Tue, 13 Aug 2002 15:32:59 -0700

On Tuesday, August 13, 2002, at 03:20 PM, Kevin Elliott wrote:

if(myval % 2 == 0)

<curmudgeon>

I'd just like to point out that even though everyone else who answered this question did a mod and compare, the result of the modulus operator is an integer, which in C is a perfectly valid boolean value.

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

</curmudgeon>

John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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: Steve Bird <email@hidden>
References: 
 >RE: Stupid newbie question - determine if integer is even or odd (From: Kevin Elliott <email@hidden>)

  • Prev by Date: Re: Stupid newbie question ? determine if intege r is even or odd
  • Next by Date: Re: =?WINDOWS-1252?Q?Stupid_newbie_que stion_=97_determine_if_intege r?= is even or odd
  • Previous by thread: RE: 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