Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | blp@cs.stanford.edu (Ben Pfaff) |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: DBL_MAX,DBL_MIN defined as? |
| Date | 2011-05-12 10:53 -0700 |
| Message-ID | <87boz7hkkd.fsf@blp.benpfaff.org> (permalink) |
| References | <46437c5a-2831-4a76-a241-f3ebdb944949@x38g2000pri.googlegroups.com> |
David Mathog <dmathog@gmail.com> writes:
> What exactly do DBL_MAX and DBL_MIN define? It looks like it is
> probably "biggest number that can be represented at a specified
> precision" and not "biggest number that can be represented".
C99 says that DBL_MAX is the maximum representable finite
floating-point number.
C99 says that DBL_MIN is the minimum normalized positive
floating-point number. There may be smaller positive
floating-point numbers, but they are denormals.
> However the lower limit seems to be a bit squishy. The number of
> correct digits in the mantissa shrinks as the exponent becomes more
> negative until the conversion fails outright, but that's much smaller
> than DIG_MIN.
DBL_MIN, you mean.
Yes, those are denormals.
> 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.
--
"Programmers have the right to be ignorant of many details of your code
and still make reasonable changes."
--Kernighan and Plauger, _Software Tools_
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
DBL_MAX,DBL_MIN defined as? David Mathog <dmathog@gmail.com> - 2011-05-12 10:42 -0700
Re: DBL_MAX,DBL_MIN defined as? blp@cs.stanford.edu (Ben Pfaff) - 2011-05-12 10:53 -0700
Re: DBL_MAX,DBL_MIN defined as? David Mathog <dmathog@gmail.com> - 2011-05-12 11:19 -0700
Re: DBL_MAX,DBL_MIN defined as? Tim Prince <tprince@computer.org> - 2011-05-12 14:55 -0400
csiph-web