home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: cs.vu.nl!irmen
- From: irmen@cs.vu.nl (Irmen de Jong)
- Subject: Re: *******HELP Decoding IEEE Floating Point Numbers*******
- Nntp-Posting-Host: fluit.cs.vu.nl
- References: <312DB0A9.41C67EA6@zeus.hud.ac.uk>
- Sender: news@cs.vu.nl
- Organization: Dept. of Computer Science, Vrije Universiteit Amsterdam
- Date: Fri, 23 Feb 1996 14:14:08 GMT
- X-Newsreader: TIN [version 1.2 PL2]
- Message-ID: <Dn8FJK.5Ct.0.-s@cs.vu.nl>
-
- On Fri, 23 Feb 1996 12:18:49 +0000 Satpal Chander (c9502007@zeus.hud.ac.uk) (Satpal Chander) wrote:
- : ---BEGIN PGP PUBLIC KEY BLOCK-----
- Why in your messages??????
-
- : Could sombody Explain to me how I can Decode 4 byte IEEE Floating point
- : numbers From binary file, in C.
-
-
- : Thanx In Advance
-
- : SATPAL CHANDER The Truth Is Within
- : Huddersfield University
- : England
-
-
- Try the following:
-
- #include <exec/types.h>
- UBYTE floatbuf[4]; /* contains the 4 bytes */
-
- double float = *(double*)floatbuf;
-
-
- Be sure to compile with FFP math, as double IEEE's are 8 bytes.
- Oh are you sure it is 4 byte *IEEE*??? I only know of 4 byte FFP format.
-
- Cheers,
- --
- / Irmen de Jong (email: irmen@cs.vu.nl WWW: http://www.cs.vu.nl/~irmen/) \
- \ ``Nothing lasts forever'' -- Species /
-