Solved

32-bit floating point notation

Posted on 1997-10-05
2
217 Views
Last Modified: 2013-12-03
Can anyone give a _clear_ description of how to manually convert floating point decimal numbers to 32-bit excess notation, in binary and hex? Please answer only if you can give step-by-step instructions to someone not so brilliant (me!). Thanx.
0
Comment
Question by:jaanders
2 Comments
 
LVL 3

Expert Comment

by:msmits
ID: 1407244
Maybe you can enlighten us where the 32-bit excess notation comes from and which applications use that.

0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 300 total points
ID: 1407245
If you're talking about accessing the 4 bytes of data (sizeof (float) == 4) that represents a float, then you can use something like

  float f = 3.1415;
  char* buffer = &f;

  for (int i = 0; i < sizeof(float); i++)
  {
    char ch = buffer[i];
    if (needAsHex)
      convertToHex(ch);
    else
      convertToBinary(ch);
  }

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now