home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 13023 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1.3 KB  |  26 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!thinkage!atbowler
  3. From: atbowler@thinkage.on.ca (Alan Bowler)
  4. Subject: Re: Convert COBOL COMP-3 to double?
  5. Message-ID: <1992Aug31.174651.14828@thinkage.on.ca>
  6. Organization: /etc/organization
  7. References: <1992Aug26.151021.4445@afs.com>
  8. Date: Mon, 31 Aug 1992 17:46:51 GMT
  9. Lines: 15
  10.  
  11. In article <1992Aug26.151021.4445@afs.com> jack@afs.com (Jack Brasch) writes:
  12. >Could someone point me in the right direction or mail me a routine to  
  13. >convert COBOL COMP-3 types to a double.
  14. >
  15.  
  16. The starting point would be the Cobol programmer's guide for your
  17. particular Cobol implementation.  Somewhere in there it should tell you
  18. exactly what COMP-3 is for that Cobol implementation.  The starnadrds
  19. only say that you can do arithemetic on comp-N items.  What the -N
  20. produces on your hardware varies with every Cobol compiler.  It is not
  21. unlikely that comp-N means different things to different compilers on
  22. the SAME hardware.  (I have seen this several times.)  When you know
  23. what the hardware is doing with comp-3 on this Cobol compiler, figuring
  24. out how to convert to a C double should be straight forward.  At worse
  25. you can move it to a DISPLAY item, and let the C code call strtod().
  26.