Win a copy of Head First Android this week in the Android forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

decoding hex values

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic