Article View: borland.public.jbuilder.java.language
Article #518Converting int to unsigned int
From: Rick
Date: Wed, 15 Jun 2005 13:00
Date: Wed, 15 Jun 2005 13:00
14 lines
1304 bytes
1304 bytes
Hi,
Probably a simple question: how to convert a signed int to an unsigned int?
My applets gets a string value holding a 16-bits integer value. Before I
want to display it, this value needs to be converted to an unsigned int(16
bits) and then back in a string. So the input string "32767" becomes
"65535".
I thought the conversion would be this,
uint16 = int16 * 2 +1
but I'm not sure though
Greetings,
Rick
Technical Details
Message-ID:
<42b02669@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f74b3,7f36f11f2652901,start X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Rick" <aso3rick@hotmail.com> From: "Rick" <aso3rick@hotmail.com> Newsgroups: borland.public.jbuilder.java.language Subject: Converting int to unsigned int Date: Wed, 15 Jun 2005 15:00:23 +0200 Lines: 16 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 193.172.62.192 Message-ID: <42b02669@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1118840425 193.172.62.192 (15 Jun 2005 06:00:25 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail