digitalmars.D.learn - floating point min, max, min_normal
- bearophile (14/14) Aug 11 2010 I vaguely remember Don talking about this, but I don't remember the conc...
- Don (3/9) Aug 12 2010 min is deprecated. It is scheduled for removal. It's deliberately no
- bearophile (4/6) Aug 12 2010 Is -double.max really the minimum double value that can be represented b...
- BCS (4/14) Aug 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
Aug 11 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.
Aug 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
Aug 12 2010
Hello bearophile,Don:IIRC IEEE floating point uses signed magnitude so yes.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-- ... <IXOYE><
Aug 12 2010