Article View: pl.comp.lang.java
Article #153927Re: przesunięcie biotwe w Java - dziwny błąd
From: bigMamma
Date: Wed, 23 Oct 2013 12:24
Date: Wed, 23 Oct 2013 12:24
33 lines
2011 bytes
2011 bytes
W dniu środa, 23 października 2013 14:22:27 UTC+2 użytkownik bigMamma napisał:
> wydawało mi się (przy moim ostatnim temacie), że przesunięcie bitowe działa prawidłowo.
>
>
>
> Mam takie wyrażenie:
>
> short w = (short) (((byte)dana) << x);
>
>
>
> ... String.format("%04X",w);
>
>
>
> jeżeli dana zawiera (byte) 0x88
>
> a x = 5
>
>
>
> to otrzymuję F100
>
>
>
> zamiast 1100
>
>
>
> Jak mogę to zmienić, aby było poprawnie!
ach! x to int.
Technical Details
Message-ID:
<1ad891af-ba67-44c5-8f1a-294cb9f42db1@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!us.feeder.erje.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!i2no29166703qav.0!news-out.google.com!rn2ni119355pbc.1!nntp.google.com!i2no29166687qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailReferences:
<fb7c6605-2b1d-4241-8bed-9caf7952f21f@googlegroups.com>Show Full Headers
Complete Article Headers
X-Received: by 10.52.64.177 with SMTP id p17mr466064vds.3.1382531041063; Wed, 23 Oct 2013 05:24:01 -0700 (PDT) X-Received: by 10.49.64.72 with SMTP id m8mr24123qes.20.1382531040806; Wed, 23 Oct 2013 05:24:00 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!us.feeder.erje.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!i2no29166703qav.0!news-out.google.com!rn2ni119355pbc.1!nntp.google.com!i2no29166687qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.java Date: Wed, 23 Oct 2013 05:24:00 -0700 (PDT) In-Reply-To: <fb7c6605-2b1d-4241-8bed-9caf7952f21f@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=31.174.200.169; posting-account=S68uugoAAADAKFnRPdRLP91xa88xg3LE NNTP-Posting-Host: 31.174.200.169 References: <fb7c6605-2b1d-4241-8bed-9caf7952f21f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1ad891af-ba67-44c5-8f1a-294cb9f42db1@googlegroups.com> Subject: Re: przesunięcie biotwe w Java - dziwny błąd From: bigMamma <marcinchuc@gmail.com> Injection-Date: Wed, 23 Oct 2013 12:24:00 +0000 X-Received-Bytes: 1772 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit