Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Travers Naran Newsgroups: comp.lang.java.programmer Subject: Re: Java left shift and right shift operators. Date: Tue, 26 Apr 2011 07:09:53 -0700 Organization: A noiseless patient Spider Lines: 32 Message-ID: References: <295e16b3-2ed8-4529-bfb0-1cc26ed93ad6@d26g2000prn.googlegroups.com> <188cz6ta97kkm$.dlg@kimmeringer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 26 Apr 2011 14:09:54 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="mZwD6WroWf8ZiutQVyui4A"; logging-data="20867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+leu74qdOqZXxx8gcyeZwi" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 In-Reply-To: Cancel-Lock: sha1:xZZMWTOU2Zi0n0CQ9UHH0GEfvBA= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3265 On 26/04/2011 6:49 AM, Lew wrote: > Lothar Kimmeringer wrote: >> Sanny wrote: >> >>> I have a problem where I have to do left shift and right shift. >>> >> [...] >>> >>> I have to use use left shift and right shift to shift Number right/ >>> left depending on value of shiftby >>> >>> if (shift>0) output = N>> shiftby; else output = N<< (-shiftby);// >>> working but inefficient. > >> In what way is it inefficient? Have you performed measurements >> or do you simply think that it's slow and want to optimize >> it prematurely? > > Sanny-Boy, I see that you posted after Lothar asked you this very, very > important question but that you did not answer this question. > > This is a conversation, not a bunch of lackeys leaping to your bid. > Please answer the questions. > > You claim inefficiency in something you have no clue whatsoever to be > inefficient. > > Here's another question, assuming you answer Lothar's question at all, > if you did perform measurements, what were the results? And people claimed I was being arrogant to insist people learn to program before they learn Java...