🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.java
Article #153929

Re: przesunięcie biotwe w Java - dziwny błąd

#153929
From: Sc0rpi0
Date: Sat, 02 Nov 2013 06:58
16 lines
1434 bytes
> Żeby zrobić to co wydaje mi się, że miało być to:
>
> short w = (short)(byte)(dana<<x);

Chociaż w sumie tak też nie, jeżeli nie chcesz  rozszerzać wyników ze 
znakiem (ujemnych), tylko:

short w = (short)(dana<<x&255);


natomiast na pewno nie uzywać ((byte)dana)<<x, bo najpierw potraktuje jako 
ujemną 8bitową i zamieni na FFFFFF88 przed przesunięciem.


-- 
Sc0rpi0
Technical Details
Message-ID: <l527fu$as9$1@news.agh.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!.POSTED!not-for-mail
References: <fb7c6605-2b1d-4241-8bed-9caf7952f21f@googlegroups.com> <1ad891af-ba67-44c5-8f1a-294cb9f42db1@googlegroups.com> <l52699$aiq$1@news.agh.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!.POSTED!not-for-mail
From: "Sc0rpi0" <sc[zero]rpi[zero]@scosys[dot]eu.org>
Newsgroups: pl.comp.lang.java
Subject: Re: przesunięcie biotwe w Java - dziwny
 błąd
Date: Sat, 2 Nov 2013 07:58:19 +0100
Organization: AGH
Lines: 18
Message-ID: <l527fu$as9$1@news.agh.edu.pl>
References: <fb7c6605-2b1d-4241-8bed-9caf7952f21f@googlegroups.com> <1ad891af-ba67-44c5-8f1a-294cb9f42db1@googlegroups.com> <l52699$aiq$1@news.agh.edu.pl>
NNTP-Posting-Host: rap.fema.krakow.pl
X-Trace: news.agh.edu.pl 1383375166 11145 195.150.11.173 (2 Nov 2013 06:52:46 GMT)
X-Complaints-To: abuse@agh.edu.pl
NNTP-Posting-Date: Sat, 2 Nov 2013 06:52:46 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit