Lost Password?


Go Back   CodeCall Programming Forum > Software Development > General Programming

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-01-2008, 10:38 AM
paintstripper paintstripper is offline
Newbie
 
Join Date: Sep 2008
Posts: 2
Rep Power: 0
paintstripper is on a distinguished road
Default How to calculate normalized float

Ok I have to calculate -89.95445 (float) to its representation in binary.

I was under the impresssion that to convert to binary that I have to:

1. Convert 89 to binary = 1011001
2. Convert decimal .95445 to binary = .111 1010 0010 1011 0110 1010
3. Normalize to get 1.011001 111 1010 0010 1011 0110 1010 . 2^6
4. So m = 1.011001 111 1010 0010 1011 0110 1010
and e = 2^6 = 64
5. So the sign = 1 because negative, the exponent = 0100 0000
and the bit pattern = 011001 111 1010 0010 1011 0110 1010

I don't think I am getting the right answer, can someone point me in the right direction?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 09-01-2008, 05:24 PM
marwex89's Avatar   
marwex89 marwex89 is offline
Guru
 
Join Date: Jul 2008
Location: Viking-land!
Posts: 3,995
Rep Power: 30
marwex89 is a jewel in the roughmarwex89 is a jewel in the roughmarwex89 is a jewel in the rough
Send a message via AIM to marwex89
Default Re: How to calculate normalized float

I think you will have to perhaps maybe take a look at this: IEEE 754-1985 - Wikipedia, the free encyclopedia
There are some standards out there for doing this, but "normal" binary won't "allow" decimal, as you know, so.... So what binary (to put it like that) will you use? Some standard, or....?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-02-2008, 04:44 AM
paintstripper paintstripper is offline
Newbie
 
Join Date: Sep 2008
Posts: 2
Rep Power: 0
paintstripper is on a distinguished road
Default Re: How to calculate normalized float

The float is stored as a normal binary value after it has been normalized. I think I just need some examples to get me going.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-03-2008, 12:07 PM
marwex89's Avatar   
marwex89 marwex89 is offline
Guru
 
Join Date: Jul 2008
Location: Viking-land!
Posts: 3,995
Rep Power: 30
marwex89 is a jewel in the roughmarwex89 is a jewel in the roughmarwex89 is a jewel in the rough
Send a message via AIM to marwex89
Default Re: How to calculate normalized float

Hmmm. I've never worked that much with binary.... Someone else?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate Square root of a number PROBLEM Esi_Gold C and C++ 8 05-06-2008 07:53 AM
open and read video files in yuv format to calculate psnr kuvlu C and C++ 0 05-04-2008 06:37 PM
I need help please! zizimetalique C and C++ 5 11-17-2007 10:39 PM
A polygon's area and volume calculate rxl_171 Visual Basic Programming 5 08-08-2007 11:01 AM
How to calculate the number of pixels in a polygon extreme Java Help 5 04-17-2007 11:34 AM


All times are GMT -5. The time now is 06:51 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads