Solved

Byte format of "single" data type

Posted on 2001-08-10
4
234 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
4 Comments
 
LVL 14

Accepted Solution

by:
AvonWyss earned 100 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 22

Expert Comment

by:mnasman
ID: 6371993
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

15 Experts available now in Live!

Get 1:1 Help Now