Just something I noticed with DOUBLE_MIN
DBL_MIN is the smallest possible normalized double, you can have denormalized doubles as well.
Since the smallest exponent is -1022, the smallest positive normalized number is 1.0 × 2-1022 ? 2.2 × 10-308. In C, this is defined as DBL_MIN. However, it is not the smallest positive number representable as a floating point number, only the smallest normalized floating point number. Smaller numbers can be expressed in denormalized form, albeit at a loss of significance. The smallest denormalized positive number occurs with f has 51 0?s followed by a single 1. This corresponds to 2-52*2-1022 = 2-1074 ? 4.9 × 10-324. Attempts to represent any smaller number must underflow to zero.
http://www.johndcook.com/blog/2009/04/06/anatomy-of-a-floating-point-number/
EDIT: And read this too http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
It is floating point math, so it can get complicated.
DBL_MIN is the minimum positive normalized value.
Your number is less than DBL_MIN, so it means your number is denormalized.
Denormal numbers are a special case in floating point numbers. They are very slow to process, and are only meaningful in exceptionally rare cases. In almost every case they are just a byproduct of rounding error.
If your number is between DBL_MIN and 0 then it is almost certainly just a result of rounding error. Round it to zero.
Also, consider what the number means. 9.88131e-324 is tiny. It is 0.0000000...[324 zeros total]...00098131. That is unfathomably close to zero.
For reference, consider the Plank length is the smallest meaningful distance measurement of the Universe. The entire Universe is only about 4.4e26 meters. That means the ratio of the entire Universe to the smallest meaningful distance is on the order of 10e-61 units, or about 0.000...[61 zeros total]...0001 units.
Anything smaller than e-61 is small enough even physics says it probably doesn't exist.
Anything smaller than DBL_MIN is small enough to be rounded to zero.
Thanks for replying, I find things like this interesting, so I'm always testing them lol.
@frob: My astronomy > Your astronomy ;). Jk lol
Just as a side-note: In C++, you better use std::numeric_limits
It also has denorm_min() which gives you the very smallest possible denormalized value. (As does DBL_TRUE_MIN, stupid name ;-))
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.