MySQL最小/最大为DOUBLE类型 [英] MySQL min/max for DOUBLE type

查看:975
本文介绍了MySQL最小/最大为DOUBLE类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DOUBLE类型的MySQL文档对于最小值和最大值都是不透明的。

The MySQL documentation for the DOUBLE type is really opaque as to what the minimum and maximum values are.


允许的值为-1.7976931348623157E + 308至-2.2250738585072014E-308 ,0和2.2250738585072014E-308至1.7976931348623157E + 308。

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.

或者,他们可以声明范围是 -1.7976931348623157E + 308 通过 1.7976931348623157E + 308 ,但是并没有给出任何关于他们可以代表的最接近零的数字的信息。 ($ code> -308 指数),您可能会认为您可以代表1E-999(您不能)。

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.

这篇关于MySQL最小/最大为DOUBLE类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆