avatar
c++ float precision# JobHunting - 待字闺中
g*s
1
it is said 7-bit significance.
suddenly get confused here. does that mean 30,000,000f and 30,000,001f
actually has the same 32-bit binary representation?
avatar
l*a
2
抠这么细?
去BB都不需要把

【在 g*********s 的大作中提到】
: it is said 7-bit significance.
: suddenly get confused here. does that mean 30,000,000f and 30,000,001f
: actually has the same 32-bit binary representation?

avatar
f*4
3
可能是要去投行吧,一个交易都是几个B的~

【在 l*****a 的大作中提到】
: 抠这么细?
: 去BB都不需要把

avatar
r*2
4
single float 32 bit
23 bit significand
avatar
g*s
5
that's the binary precision.
for decimal, it's log10(2^23) = 7.

【在 r*********2 的大作中提到】
: single float 32 bit
: 23 bit significand

avatar
r*2
6
ah, 我错了
对的,尾数一样single precision float就是这个精度吧。
avatar
n*0
7
如果只能表达这俩数的前7bit的话,那应该是一样的。不过正常的计算机里面除了7bit
significance以外后面通常会多出一坨无意义的bit。考虑到后面这种情况,两个30,
000,000f之间的表示都是有可能不一样的。

【在 g*********s 的大作中提到】
: it is said 7-bit significance.
: suddenly get confused here. does that mean 30,000,000f and 30,000,001f
: actually has the same 32-bit binary representation?

avatar
c*o
8
In order to understand the precision, it is better to know how float are
stored in memory. Generally, for float number K, the precision is
2^(log_2(k)-23), when K is between 1 and 2, 2^(-23)~10^(-7).

7bit

【在 n*******0 的大作中提到】
: 如果只能表达这俩数的前7bit的话,那应该是一样的。不过正常的计算机里面除了7bit
: significance以外后面通常会多出一坨无意义的bit。考虑到后面这种情况,两个30,
: 000,000f之间的表示都是有可能不一样的。

avatar
a*1
9
64 bit machine上float也还是32吗?比int还小?
avatar
c*o
10
try sizeof to test

【在 a********1 的大作中提到】
: 64 bit machine上float也还是32吗?比int还小?
avatar
g*s
11
it is said 7-bit significance.
suddenly get confused here. does that mean 30,000,000f and 30,000,001f
actually has the same 32-bit binary representation?
avatar
l*a
12
抠这么细?
去BB都不需要把

【在 g*********s 的大作中提到】
: it is said 7-bit significance.
: suddenly get confused here. does that mean 30,000,000f and 30,000,001f
: actually has the same 32-bit binary representation?

avatar
f*4
13
可能是要去投行吧,一个交易都是几个B的~

【在 l*****a 的大作中提到】
: 抠这么细?
: 去BB都不需要把

avatar
r*2
14
single float 32 bit
23 bit significand
avatar
g*s
15
that's the binary precision.
for decimal, it's log10(2^23) = 7.

【在 r*********2 的大作中提到】
: single float 32 bit
: 23 bit significand

avatar
r*2
16
ah, 我错了
对的,尾数一样single precision float就是这个精度吧。
avatar
n*0
17
如果只能表达这俩数的前7bit的话,那应该是一样的。不过正常的计算机里面除了7bit
significance以外后面通常会多出一坨无意义的bit。考虑到后面这种情况,两个30,
000,000f之间的表示都是有可能不一样的。

【在 g*********s 的大作中提到】
: it is said 7-bit significance.
: suddenly get confused here. does that mean 30,000,000f and 30,000,001f
: actually has the same 32-bit binary representation?

avatar
c*o
18
In order to understand the precision, it is better to know how float are
stored in memory. Generally, for float number K, the precision is
2^(log_2(k)-23), when K is between 1 and 2, 2^(-23)~10^(-7).

7bit

【在 n*******0 的大作中提到】
: 如果只能表达这俩数的前7bit的话,那应该是一样的。不过正常的计算机里面除了7bit
: significance以外后面通常会多出一坨无意义的bit。考虑到后面这种情况,两个30,
: 000,000f之间的表示都是有可能不一样的。

avatar
a*1
19
64 bit machine上float也还是32吗?比int还小?
avatar
c*o
20
try sizeof to test

【在 a********1 的大作中提到】
: 64 bit machine上float也还是32吗?比int还小?
avatar
r*t
21
The earlier discussions in this thread are very confusion. The answer (i
think) is yes to this question. BTW, (i think) "7-bit significance" is 笔误

【在 g*********s 的大作中提到】
: it is said 7-bit significance.
: suddenly get confused here. does that mean 30,000,000f and 30,000,001f
: actually has the same 32-bit binary representation?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。