• 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: potential endian-related problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: potential endian-related problem?


  • Subject: Re: potential endian-related problem?
  • From: Steve Bird <email@hidden>
  • Date: Fri, 8 Jul 2005 06:48:59 -0400


On Jul 8, 2005, at 6:32 AM, Chase wrote:

on my ppc-mac, this code:

    int i;
    for (i = 1; i; i<<=1) {
        printf("%d\n", i);
    }


this, to me, looks like it's going to need an adjustment to work the same on intel.


Why would it work differently? 2+2 still equals 4, even in Intelliville.

1 << 1 still equals 2.

1024 << 1 still equals 2048.

The "endian" issue refers to how you STORE the numbers (does the little end go first, or the big end?).
It has nothing to do with the rules of arithmetic.



---------------------------------------------------------------- Steve Bird Culverson Software - Elegant software that is a pleasure to use. www.Culverson.com (toll free) 1-877-676-8175


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >potential endian-related problem? (From: Chase <email@hidden>)

  • Prev by Date: potential endian-related problem?
  • Next by Date: Re: potential endian-related problem?
  • Previous by thread: potential endian-related problem?
  • Next by thread: Re: potential endian-related problem?
  • Index(es):
    • Date
    • Thread