Path: utzoo!attcan!uunet!husc6!mailrus!iuvax!rutgers!mcnc!rti!sunpix!matthew From: matthew@sunpix.UUCP ( Sun NCAA) Newsgroups: comp.lang.c Subject: Re: #include Message-ID: <355@greens.UUCP> Date: 23 Dec 88 19:16:43 GMT References: <354@greens.UUCP> <1920@paris.ics.uci.edu> <11252@haddock.ima.isc.com> Organization: Sun Microsystems, Research Triangle Park, NC Lines: 23 In article <11252@haddock.ima.isc.com>, karl@haddock (Karl Heuer) writes: > > Btw, the posted version of the function accepts "3.14xyz" as valid (as does > atof() itself). I would think that the problem as stated should require that > string to be rejected. > > Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint Now that strtol() && strtod() have been pointed out to me, I've had a chance to look them over. Thanks all. As for the problem I stated, Any number acceptable to atof(), and would produce a valid number output, was acceptable. I devised isfloat() && isint() to test for atof() && atoi() acceptablity ( I wrote them so that I was sure that if atof() did return a 0.0, that it was indeed a value of 0.0). Also, the class is using an older compiler, which does not support strtol() && strtod(), so could not have been used in my problem in the first place. -- Matthew Lee Stier (919) 469-8300| Sun Microsystems --- RTP, NC 27560| "Wisconsin Escapee" uucp: {sun, rti}!sunpix!matthew |