Solved

32-bit floating point notation

Posted on 1997-10-05
2
218 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Save copy of document in Word 4 83
DataAdapter, stored procedures and parameters 2 50
C#: need to import an entire CSV file 4 55
What are the big features of MVC5? 4 87
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
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…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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