Jump to content

Floation point representation into real numbers

- - - - -

  • Please log in to reply
No replies to this topic

#1
nicckk

nicckk

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 629 posts
Edit: Never mind, I got it.

Hey guys, I've started my new computer science course and I'm having some trouble converting floating point representation into real numbers.

The number I am trying to convert is 1 10010010 1110000000000000000000

The sign bit is on, signifying the number is negative. All I know so far is that the normalized value is .9375(.5 + 2^-2 + 2^-3 + 2^-4). I am having trouble finding the value of the exponent. Subtracting the exponent from the bias(10010010 - 10000000) leaves a result of 10010, or 18. Solving for x/(2^18) = .9375 gives a value of 245760. So the real number should be -245760.

I used a floating point calculator and it gave me back a value of -983040.0, very far off from my answer. I'm not sure where I am going wrong, hopefully someone can help.

Thanks,
Nick.

Edited by nicckk, 10 September 2011 - 10:35 AM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users