home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / ultrix / 9575 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.9 KB

  1. Xref: sparky comp.unix.ultrix:9575 comp.sys.dec:7189 comp.lang.c:20353
  2. Newsgroups: comp.unix.ultrix,comp.sys.dec,comp.lang.c
  3. Path: sparky!uunet!scifi!acheron!philabs!linus!agate!ames!eos!kozon
  4. From: kozon@eos.arc.nasa.gov (Tom Kozon)
  5. Subject: unix-ultrix VAX-IEEE number conversions
  6. Message-ID: <1993Jan28.201135.25383@eos.arc.nasa.gov>
  7. Organization: NASA Ames Research Center
  8. Distribution: usa
  9. Date: Thu, 28 Jan 1993 20:11:35 GMT
  10. Lines: 26
  11.  
  12. Hello,
  13.  
  14. I am currently in the process of porting some software from
  15. one system (DEC VAX 785 running BSD 4.3 unix) to another (Decsystem
  16. 5100 running ULTRIX RISC V4.2).  Some of this software has the function of 
  17. reading a binary stream of VAX data. While integer data types are read on 
  18. the Decsystem with no difficulties, I am finding that I will need to 
  19. convert floating point and double precision numbers from VAX into IEEE 
  20. format. So far, I've written a couple of standalone test programs (running 
  21. on the Decsystem) using the C library functions developed to do these 
  22. conversions.  I've been able to successfully use " ftoi " to make accurate 
  23. floating point conversions with no problems.  However, the function that 
  24. transforms the double precision numbers (i.e., " dtoi ") seems to present 
  25. some special difficulties.  In general, it seems to convert a VAX double 
  26. precision number into its IEEE format (mostly, but sometimes not), but 
  27. almost never returns a " 0 " integer value indicating the conversion 
  28. has been successfully made. According to the on-line documentation, if 
  29. this function returns a non-zero value, it does not do the conversion.  
  30. So, why would my experience be accurate transformations with nonzero 
  31. function return values?  The C program that uses dtoi generally works 
  32. in the same manner as the one using ftoi, so these results seem surprising.  
  33. Any suggestions/clues on this matter would be greatly appreciated -- 
  34. thanks in advance for posted and/or E-mail replies!
  35.  
  36. Tom
  37. kozon@eos.arc.nasa.gov
  38.