Re: Unsigned Long Long
Re: Unsigned Long Long
- Subject: Re: Unsigned Long Long
- From: Steve Bird <email@hidden>
- Date: Wed, 12 May 2004 22:14:27 -0400
On May 12, 2004, at 9:15 PM, Sherm Pendley wrote:
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;
As long as we're picking nits here, I would suggest shifting in the
other direction.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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.