mysql double最大值,MySQL最小/最大为DOUBLE类型

The MySQL documentation for the DOUBLE type is really opaque as to 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值