Thread overview
floating point min, max, min_normal
Aug 12, 2010
bearophile
Aug 12, 2010
Don
Aug 12, 2010
bearophile
Aug 12, 2010
BCS
August 12, 2010
I vaguely remember Don talking about this, but I don't remember the conclusions, and there is something strange.

In this page among the properties of floating point values the min seems missing: http://www.digitalmars.com/d/2.0/property.html

Yet the min is present and returns the same value as min_normal:

import std.stdio;
void main() {
    writeln(double.min);        //  2.22507e-308
    writeln(double.max);        //  1.79769e+308
    writeln(double.min_normal); //  2.22507e-308
    writeln(-double.max);       // -1.79769e+308
}

In generic code I have used min, but the min for floating point values is very different from the min for integral values. Is it possible to change double.min to something similar to -double.max? Otherwise I suggest to just remove double.min, because it's confusing for me and my code.

Bye,
bearophile
August 12, 2010
bearophile wrote:
> I vaguely remember Don talking about this, but I don't remember the conclusions, and there is something strange.
> 
> In this page among the properties of floating point values the min seems missing:
> http://www.digitalmars.com/d/2.0/property.html
> 
> Yet the min is present and returns the same value as min_normal:

min is deprecated. It is scheduled for removal. It's deliberately no longer included in the list of properties.
August 12, 2010
Don:
> min is deprecated. It is scheduled for removal. It's deliberately no longer included in the list of properties.

Is -double.max really the minimum double value that can be represented before -inf?

Bye,
bearophile
August 12, 2010
Hello bearophile,

> Don:
> 
>> min is deprecated. It is scheduled for removal. It's deliberately no
>> longer included in the list of properties.
>> 
> Is -double.max really the minimum double value that can be represented
> before -inf?
> 

IIRC IEEE floating point uses signed magnitude so yes.

> Bye,
> bearophile
-- 
... <IXOYE><