• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

numeric conversions

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does FFFF FFF1 convert to in base 10?
 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Otto
FFFF FFF1
7654 3210
FFFFFFF1 = 15*16^7+15*16^6+15*16^5+15*16^4+15*16^3+15*16^2+15*16^1+1*16^0
Jamal Hasanov
www.j-think.com
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe it converts to -15 in base 10.
Brian
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Brian Lugo:
I believe it converts to -15 in base 10.
Brian


Doesn't it depend if the number signed or unsigned?
 
Brian Lugo
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thats very true Jessica, I assumed the number was a 32 bit signed integer (in Java) and not 32 bit float.
Brian
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jessica Sant:

Doesn't it depend if the number signed or unsigned?


How a number is converted from Hex to Decimal is dependent upon if the number is signed or unsigned and also if the number is an integer value or a floating point value.
Obviously, whether the value is signed or unsigned lets us know whether the most significant bit is a data bit or a sign bit.
If you're dealing with a floating point value, part of that value is interpreted as an exponent. You can check out this thread for details about this.
However, for the exam, you'll probably be safe knowing how to convert signed ints between the various bases (dec, hex, oct, bin).
Corey
 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic