为什么double.MaxValue大于long.MaxValue? [英] Why double.MaxValue is larger than long.MaxValue?

查看:136
本文介绍了为什么double.MaxValue大于long.MaxValue?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

都保留8个字节,但是double的最大值为何比long的最大值大 ?可用位数有限,所以如何用浮点变量达到更大的位数?

both of them hold 8 bytes, but how come the max value for double is much greater than the max value of long? there is a finite number of bits available, so how could you reach greater numbers with floating point variables?

推荐答案

使用指数和尾数表示(浮点)

It uses a different representation (floating point) using exponents and mantissa

有关详细信息,请参见 IEEE754

For details see IEEE754

这篇关于为什么double.MaxValue大于long.MaxValue?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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