Solved

# 32-bit floating point notation

Posted on 1997-10-05
216 Views
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
Question by:jaanders

LVL 3

Expert Comment

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

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

## Join & Write a Comment Already a member? Login.

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.

#### Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!