问题描述
对于激烈的数字计算,我正在考虑使用固定点而不是浮点数。当然,固定点类型的大小有多少个字节,运行在哪个CPU上,如果我可以使用MMX或SSE或任何新的东西, p>我想知道如果现在浮点运行的速度比以前更快,是否值得考虑固定点?是否有一般的经验法则,我们可以说它会超过几个百分点?从35000英尺的数字表现来看,什么是概述? (顺便说一句,我假设一般的CPU在大多数电脑中找到,而不是DSP或专门的嵌入式系统。) 解决方案
我想知道如果现在浮点运行的速度比以前更快,是否值得考虑固定点?是否有一般的经验法则,我们可以说它会超过几个百分点?从35000英尺的数字表现来看,什么是概述? (顺便说一句,我假设一般的CPU在大多数电脑中找到,而不是DSP或专门的嵌入式系统。) 解决方案
还是值得的。浮点比过去快,但定点也是。如果您关心IEEE 754保证的精度,那么固定仍然是唯一的选择。
For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up...
I'm wondering if these days when floating point runs faster than ever, is it ever worth considering fixed point? Are there general rules of thumb where we can say it'll matter by more than a few percent? What is the overview from 35,000 feet of numerical performance? (BTW, i'm assuming a general CPU as found in most computers, not DSP or specialized embedded systems.)
It's still worth it. Floating point is faster than in the past, but fixed-point is also. And fixed is still the only way to go if you care about precision beyond that guaranteed by IEEE 754.
这篇关于这些天何时使用固定点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!