双数精度高 [英] High precision in double numbers

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

问题描述




double 类型有64位宽度,可以保存小到1e的数字-308。

i想要的数据类型甚至小于两倍。



i读取 长的帮助double 有80位宽,可以存储小到1e-4000,但在VC中,当我声明一个这种类型的变量时,它会威胁为double类型。



问题出在哪里?



谢谢

Hi
double type has 64 bit width and can hold number as small as 1e-308.
i want a data type even smaller than double.

i read in help that long double has 80 bit width and can store as small as 1e-4000, but in VC, when i declare a variable with this type, it threats as double type.

where is the problem?

thanks

推荐答案

您可以使用库(例如,参见维基百科上的任意精度算术库 [ ^ ])。
You might use a library (see, for instance, Arbitrary-precision arithmetic libraries at Wikipedia[^]).


MSDN [ ^ ]说双倍和长双倍是相同的。



但是CPP参考说你可以定义一个long double by在最后加上''L'阅读更多信息,请访问 Double and Long Double [ ^ ]
MSDN[^] says double and long double are same.

but CPP reference says you can define a long double by putting a ''L'' at the end read more at Double and Long Double[^]


浮点大于double不像float或double那样标准化。它更依赖于编译器和平台。



http:// en .wikipedia.org / wiki / Long_double [ ^ ]



如果你真的需要更高的精度,你可以寻找像英特尔那样的另一个编译器,或者寻找一个库。
Floating points bigger than a double are not as standardized as float or double. It is much more compiler and Platform dependant.

http://en.wikipedia.org/wiki/Long_double[^]

If you really need more precision, you can either look for another compiler like the one from Intel or look for a library.


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

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