• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

decoding hex values

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any easy method to decode such hex values into decimal values?0x7FFFFFFF


If there is no easy procedure , what is the normal procedure?


Regards,
Yashwanth
 
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by yashwanth reddy:
Is there any easy method to decode such hex values into decimal values?0x7FFFFFFF


If there is no easy procedure , what is the normal procedure?


Regards,
Yashwanth



(7 * 16^7) + (15 * 16^6) + (15 * 16^5) + (15 * 16^4) + (15 * 16^3) + (15 * 16^2) + (15 * 16^1) + (15 * 16^0)

Or, convert to binary first (then convert to decimal)...

0111 1111 1111 1111 1111 1111 1111 1111
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u can use the method in Integer wrapper class as follows:::

String hexVal = "A"; //Hexadecimal

int decvalue= Integer.parseInt(hexVal,16);
 
Steve Morrow
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by brij tiwari:
u can use the method in Integer wrapper class as follows:::

String hexVal = "A"; //Hexadecimal

int decvalue= Integer.parseInt(hexVal,16);



Indeed - I thought the OP was asking about the actual process, rather than the API. Thanks for adding that!
[ December 29, 2005: Message edited by: Steve Morrow ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic