Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #3824

Re: DBL_MAX,DBL_MIN defined as?

From Tim Prince <tprince@computer.org>
Newsgroups comp.lang.c
Subject Re: DBL_MAX,DBL_MIN defined as?
Date 2011-05-12 14:55 -0400
Message-ID <932ooeFgdhU1@mid.individual.net> (permalink)
References <46437c5a-2831-4a76-a241-f3ebdb944949@x38g2000pri.googlegroups.com> <87boz7hkkd.fsf@blp.benpfaff.org>

Show all headers | View raw


On 5/12/2011 1:53 PM, Ben Pfaff wrote:
> 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.
of type double
>
> C99 says that DBL_MIN is the minimum normalized positive
> floating-point number.
of type double
> There may be smaller positive
doubles
> , 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.
If your CPU is set to IEEE gradual underflow mode, the smallest non-zero 
positive double is DBL_MIN*DBL_EPSILON, and it might be expected to have 
1 bit of precision.

>
> Yes, those are denormals.
>

In abrupt underflow mode, DBL_MIN would be the smallest positive double. 
  In either case, it's the smallest one for which DBL_MANT_DIG is valid.
Most compilers have a optimization flag which includes the effect of 
causing main() to initialize the CPU to abrupt underflow, if the OS 
itself doesn't do that.

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


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