?
Solved

Byte format of "single" data type

Posted on 2001-08-10
4
Medium Priority
?
243 Views
Last Modified: 2010-04-06
Can anyone explain the byte format (4 bytes) of the Delphi "single" floating point data type.
I have a Delphi app that writes "single" data type values to a file and I would like to read the data file using a non-Delphi app.
0
Comment
Question by:zebada
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 14

Accepted Solution

by:
AvonWyss earned 400 total points
ID: 6371951
It's the normal IEEE standard single data type.
http://www.psc.edu/general/software/packages/ieee/ieee.html
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6371995
Hi zebada,

It's really standard type. E.g. it used in 80287 coprocessor.
31 bit - Sign
30...23 Exponent
22...0 Fracation

If you are going to load it to application that  builded with compiller supported "Single type", then just load it directly to variable.

-----
Igor
0
 
LVL 6

Author Comment

by:zebada
ID: 6372026
Thanks to all,

AvonWyss was first. I should've known but I was using "Hex Editor" with the byte order accidentally set to Motorola instead of Intel. So I was seeing really strange numbers when it was interpreting the 4-byte single values. I concluded (incorrectly) that Delphi was using non-standard floating point formats. DOH!

Cheers
Paul
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

765 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