开发者

MySQL min/max for DOUBLE type

The MySQL documentation for the DOUBLE type is really opaque as 开发者_如何学JAVAto what the minimum and maximum values are.

Permissible values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and 2.2250738585072014E-308 to 1.7976931348623157E+308.

This doesn't make sense to me. Maybe I'm being a mathtard, but I'm not understanding this. There appears to be two possible ranges and zero.


Yes, it has a range of possible positive values, zero, and a range of possible negative values.

The reason they're doing it that way is to ensure you get both the maximum and minimum possible numbers on either side of zero.

Alternatively, they could state that the range is -1.7976931348623157E+308 through 1.7976931348623157E+308 but that doesn't give you any information about the numbers closest to zero that they can represent. (the ones with the -308 exponent) and you may think you can represent 1E-999 (which you can't).

For the unsigned variant, it just disallows the negative range, which is possibly another reason why they specified the two ranges separately - you can just ignore the negative range totally in that case.


The closest Double to zero is

2.2250738585072014E-308 positive

-2.2250738585072014E-308 negative

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜