double.min - should be 5e-324?
Dmitry Olshansky
dmitry.olsh at gmail.com
Sat Dec 4 13:22:58 PST 2010
Well, to keep things short, double.min returns something weird.
See the following for demonstration:
import std.stdio;
void main(){
double r = double.max, r2 = double.min;
writeln(r);//1.79769e+308
r *= 2;//test if it's max
writeln(r); // infinity, ok
writeln(r2);//2.22507e-308, wtf ?
r2 /= 2.0;
writeln(r2);// 1.11254e-308, a logical consequence of above
double dmin = 5e-324;
writeln(dmin);// 4.94066e-324
dmin /= 2.0;
writefln(dmin);// 0
}
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list