[英] double

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

问题描述



我想知道0之后有多少位数会加倍。如果在特殊情况下不够大的话,还有

吗?

谢谢,

MJKUOG

解决方案

MJKUOG写道:




我想知道0之后的数字会保持多少。如果在特殊情况下不够大的话,还有

吗?

谢谢,

MJKUOG


假设IEEE-754,您有一个52位的尾数。从那里开始工作。


red floyd写道:


MJKUOG写道:


>
我想知道''0'之后有多少位数会加倍。



" After''0''"?你的意思是小数点后吗?


是否有


>无论如何增加它在特殊情况下不够大?
谢谢,
MJKUOG



假设IEEE-754,你有一个52位的尾数。从那里开始工作。



没有必要承担任何责任。使用值

std :: numeric_limits< double> :: digits10找出总数

可表示的小数位数,然后减去
$ b的数量小数点前的$ b位数,如果那真的是你之后的价格。


V

-

请在通过电子邮件回复时删除资金''A'

我没有回复最热门的回复,请不要问


Hi,
I am wondering how many digits after ''0'' does double keeps. Is there
anyway to increase it if it is not big enough in special cases?
Thanks,
MJKUOG

解决方案

MJKUOG wrote:

Hi,
I am wondering how many digits after ''0'' does double keeps. Is there
anyway to increase it if it is not big enough in special cases?
Thanks,
MJKUOG

Assuming IEEE-754, you have a 52-bit mantissa. Work from there.


red floyd wrote:

MJKUOG wrote:

>Hi,
I am wondering how many digits after ''0'' does double keeps.

"After ''0''"? Do you mean after decimal point?

Is there

>anyway to increase it if it is not big enough in special cases?
Thanks,
MJKUOG


Assuming IEEE-754, you have a 52-bit mantissa. Work from there.

There is no need to assume anything. Use the value of
std::numeric_limits<double>::digits10 to find out the total
representable decimal positions, then subtract the number of
digits before the decimal point, if that''s truly what you''re
after.

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


这篇关于双的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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