home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3703 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  43 lines

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