Ask a Question related to Mac Programming, Design and Development.
-
Korbin Meiser #1
Bit shifts in Cocoa
Does anyone know how to do bit shifts in Cocoa? I have declared an
integer and I want to shift it one bit to the right (same as dividing
by 2). How can this be done in Cocoa? I already tried "x >> 1", but
it did not recognize the ">>" syntax. I'm also interested in
information about other mathematical logical syntax in Cocoa. I
didn't find anything about that on the apple developer web site. Any
help is appreciated.
-Korbin
Korbin Meiser Guest
-
#39422 [NEW]: Time shifts randomly between GMT and PST
From: daemonist at guildmail dot sojurn dot org Operating system: Windows 2003 Server PHP version: 4CVS-2006-11-08 (CVS) PHP Bug... -
Colour Shifts with CS
Hello All, I'm having some big colour shifting issues with my Illustrator CS files. I have a logo that I am sending to various third party sources.... -
Slicing shifts layout....?
Hi, I've got a problem with slicing, for some reason I can slice 4/5 of my page. The bottom (1/5) I can't touch, when I do that, and preview I get... -
Cocoa Filemaker
"Edward Smith" <esmith@thegoodstuff.se> wrote in message news:BB44ABA1.4676%esmith@thegoodstuff.se... I presume so. There was a statement from... -
Text shifts in Netscape
What can I do to stop text from shifting within layers when the site is opened in Netscape? -
Michael J Ash #2
Re: Bit shifts in Cocoa
On 10 Sep 2003, Korbin Meiser wrote:
First of all, your question as asked doesn't make sense. Cocoa is not a> Does anyone know how to do bit shifts in Cocoa? I have declared an
> integer and I want to shift it one bit to the right (same as dividing
> by 2). How can this be done in Cocoa? I already tried "x >> 1", but
> it did not recognize the ">>" syntax. I'm also interested in
> information about other mathematical logical syntax in Cocoa. I
> didn't find anything about that on the apple developer web site. Any
> help is appreciated.
programming langauge, it is an API. You probably meant Objective-C, which
is the langauge normally used with Cocoa.
Objective-C is just C with some OO stuck on. So all the basic math
operators are the same. Your "x >> 1" statement should work. If it
doesn't, it's either because you have another error, or you're not using
Objective-C.
--
"From now on, we live in a world where man has walked on the moon.
And it's not a miracle, we just decided to go." -- Jim Lovell
Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>
Michael J Ash Guest
-
Uli Kusterer #3
Re: Bit shifts in Cocoa
In article <be168cf0.0309101256.6792012d@posting.google.com >,
[email]cryptofish@hotmail.com[/email] (Korbin Meiser) wrote:
It would help if you told us what programming language you're using. :-T> Does anyone know how to do bit shifts in Cocoa? I have declared an
> integer and I want to shift it one bit to the right (same as dividing
> by 2). How can this be done in Cocoa? I already tried "x >> 1", but
> it did not recognize the ">>" syntax. I'm also interested in
> information about other mathematical logical syntax in Cocoa. I
> didn't find anything about that on the apple developer web site. Any
> help is appreciated.
The languages that have Cocoa bindings that I know of include
Objective C
Java
Python
Perl
AppleScript
and there are probably just as many others. Some of them support
bit-shifts, others don't. Objective C (which is the language you'll want
to be using if you're doing anything as advanced as a bit-shift)
supports the << and >> operators just fine.
Cheers,
-- M. Uli Kusterer
[url]http://www.zathras.de[/url]
Uli Kusterer Guest



Reply With Quote

