Solved

32-bit floating point notation

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

13 Experts available now in Live!

Get 1:1 Help Now