home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.applications
- Path: sparky!uunet!sun-barr!ames!haven.umd.edu!darwin.sura.net!gatech!concert!sas!mozart.unx.sas.com!jamie
- From: jamie@cdevil.unx.sas.com (James Cooper)
- Subject: Re: SAS C 6.0
- Originator: jamie@cdevil.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BuF4AL.4IG@unx.sas.com>
- Date: Fri, 11 Sep 1992 14:30:21 GMT
- References: <Bu9EGK.Gvn@unx.sas.com> <1992Sep10.192942.10151@fcom.cc.utah.edu>
- Nntp-Posting-Host: cdevil.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 40
-
-
- In article <1992Sep10.192942.10151@fcom.cc.utah.edu>, dave@news.ccutah.edu (dave martin) writes:
- >I just discovered two days ago that atof in 5.10b with ansi libraries
- >is "broke". I quote it because it just occured to me that it may be
- >returning long double which the 5.10 compiler doesn't support.
- >I'm compiling with -cfirst -f8 (and linking with approprate libraries);
- >it returns 0 for "0" and "0.0" but returns things
- >like 1.2423e+173 for things like "1.0".
- >
- >Anyway, is it broke, and if so is it fixed?
- >I've resorted to using sscanf in the meantime.
-
- How is it "broke"? Can you post some sample code to show the problem?
-
- I tried this code:
-
- #include <stdio.h>
- #include <math.h>
-
- void main(void)
- {
- printf("%f\n", atof("1.0"));
- }
-
- and under regular 5.10b and 5.10b with the ANSI libs, I get:
-
- 1.000000
-
- printed on the screen.
-
- Under 6.0, you have to #include <stdlib.h> instead of #include <math.h>
- (to have ANSI compliance), but I still get the same answer...
-
- --
- ---------------
- Jim Cooper
- (jamie@unx.sas.com) bix: jcooper
-
- Any opinions expressed herein are mine (Mine, all mine! Ha, ha, ha!),
- and not necessarily those of my employer.
-