gpt4 book ai didi

java - 数字 "overall magnitude"的含义

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:20:36 26 4
gpt4 key购买 nike

我对 Java 语言规范中“总体规模”的含义感到困惑:

Widening primitive conversions do not lose information about the overall magnitude of a numeric value.

是“数量级”,还是“绝对值”?还是别的?

最佳答案

来自维基百科文章,Magnitude (mathematics) :

In mathematics, magnitude is the size of a mathematical object, a property by which the object can be compared as larger or smaller than other objects of the same kind.

用简单的英语来说,32767的量级就是32767,量级相当于这个数的值。

在 JLS 规范中,我认为他们使用幅度来表示数字中的位数。 32767 是可以放入带符号的 16 位字段的最大整数。如果将 32767 移到少于 15 位的位域中,则该数字将不再是 32767。这就是所谓的缩小。如果将 32767 移动到超过 15 位(或 16 位,有符号)的位域中,则 32767 的值将被保留。这就是所谓的拓宽。

一个数量级是从数字中增加或减少一个数字。例如,使用10进制整数,32767比3276高一个数量级。3276比327高一个数量级。

关于java - 数字 "overall magnitude"的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31791724/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com