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

Re: Unsigned Long Long


  • Subject: Re: Unsigned Long Long
  • From: Sherm Pendley <email@hidden>
  • Date: Wed, 12 May 2004 21:15:01 -0400

On May 12, 2004, at 5:39 PM, Fritz Anderson wrote:

An unsigned long long is simply a 64-bit integer, in the range 0 .. (2^64)-1.

Just to pick nits - the C99 standard requires it to be a minimum of 64-bits wide, but allows it to be bigger. Always use sizeof() if knowing the exact storage size is important to you.

You do arithmetic on it the same way you'd do it on any other integer. Divide by 1024 to get KB.

Bit-shifting is faster than division:

long long kb = b << 10;

Assuming of course that GCC doesn't optimize division by a constant power of 2 into a bit-shift on its own.

sherm--
_______________________________________________
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: Unsigned Long Long
      • From: Steve Bird <email@hidden>
    • Re: Unsigned Long Long
      • From: Clark Cox <email@hidden>
References: 
 >Unsigned Long Long (From: email@hidden)
 >Re: Unsigned Long Long (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: NSImageView printing in landscape orientation
  • Next by Date: How do I choose a network port for listening/broadcasting? (REPOST)
  • Previous by thread: Re: Unsigned Long Long
  • Next by thread: Re: Unsigned Long Long
  • Index(es):
    • Date
    • Thread