home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / applicat / 7114 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.7 KB  |  54 lines

  1. Newsgroups: comp.sys.amiga.applications
  2. Path: sparky!uunet!sun-barr!ames!haven.umd.edu!darwin.sura.net!gatech!concert!sas!mozart.unx.sas.com!jamie
  3. From: jamie@cdevil.unx.sas.com (James Cooper)
  4. Subject: Re: SAS C 6.0
  5. Originator: jamie@cdevil.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <BuF4AL.4IG@unx.sas.com>
  8. Date: Fri, 11 Sep 1992 14:30:21 GMT
  9. References: <Bu9EGK.Gvn@unx.sas.com> <1992Sep10.192942.10151@fcom.cc.utah.edu>
  10. Nntp-Posting-Host: cdevil.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 40
  13.  
  14.  
  15. In article <1992Sep10.192942.10151@fcom.cc.utah.edu>, dave@news.ccutah.edu (dave martin) writes:
  16. >I just discovered two days ago that atof in 5.10b with ansi libraries
  17. >is "broke".  I quote it because it just occured to me that it may be
  18. >returning long double which the 5.10 compiler doesn't support.
  19. >I'm compiling with -cfirst -f8 (and linking with approprate libraries);
  20. >it returns 0 for "0" and "0.0" but returns things
  21. >like 1.2423e+173 for things like "1.0".
  22. >
  23. >Anyway, is it broke, and if so is it fixed?
  24. >I've resorted to using sscanf in the meantime.
  25.  
  26. How is it "broke"?  Can you post some sample code to show the problem?
  27.  
  28. I tried this code:
  29.  
  30. #include <stdio.h>
  31. #include <math.h>
  32.  
  33. void main(void)
  34. {
  35.     printf("%f\n", atof("1.0"));
  36. }
  37.  
  38. and under regular 5.10b and 5.10b with the ANSI libs, I get:
  39.  
  40. 1.000000
  41.  
  42. printed on the screen.
  43.  
  44. Under 6.0, you have to #include <stdlib.h> instead of #include <math.h>
  45. (to have ANSI compliance), but I still get the same answer...
  46.  
  47. -- 
  48. ---------------
  49. Jim Cooper
  50. (jamie@unx.sas.com)                             bix: jcooper
  51.  
  52. Any opinions expressed herein are mine (Mine, all mine!  Ha, ha, ha!),
  53. and not necessarily those of my employer.
  54.