#include <is.h>

Sun NCAA matthew at sunpix.UUCP
Sat Dec 24 05:16:43 AEST 1988


In article <11252 at haddock.ima.isc.com>, karl at 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 at 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     |



More information about the Comp.lang.c mailing list