David Mathog
5/12/2011 6:19:00 PM
On May 12, 10:53 am, b...@cs.stanford.edu (Ben Pfaff) wrote:
> David Mathog <dmat...@gmail.com> writes:
> > Are we really supposed to have to do a
> > if(dtmp < DIG_MIN){ reject_it(); }
>
> I'm not sure how to interpret the standard's wording in this
> area, but if that's what your implementation does then I'd guess
> that, yes, you have to.
Oops, all negative numbers will fail that test and be rejected. Ah, I
see, use fpclassify() and look for FP_SUBNORMAL. Seems like an odd
design choice for strtod() though. I can only think of a single
instance where I would want it to accept a subnormal value - for
testing what other pieces of code would do if they happened to
generate a subnormal value during a calculation. Even then, why not
set errno when that happens?
Thanks,
David Mathog