Solved

Byte format of "single" data type

Posted on 2001-08-10
4
239 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 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:Mohammed Nasman
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

732 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