math.h的效率 [英] Efficiency of math.h

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

问题描述

大家好,


通常情况下,我相信ANSI库的编写尽可能高效,但我有一个应用程序其中大部分运行时间都是调用acos(...)方法。所以现在我开始想知道这个方法和math.h库中的其他方法是如何实现的。

Dave

Hi all,

Normally, I would trust that the ANSI libraries are written to be as
efficient as possible, but I have an application in which the majority of
the run time is calling the acos(...) method. So now I start to wonder how
that method, and others in the math.h library, are implemented.
Dave

推荐答案

Dave Rudolf< nu **************** @ hotmail.com>潦草地写道:
Dave Rudolf <nu****************@hotmail.com> scribbled the following:
大家好,
通常情况下,我相信ANSI库的编写尽可能高效,但我有一个应用程序,其中大多数运行时调用acos(...)方法。所以现在我开始想知道该方法以及math.h库中的其他方法是如何实现的。
Hi all, Normally, I would trust that the ANSI libraries are written to be as
efficient as possible, but I have an application in which the majority of
the run time is calling the acos(...) method. So now I start to wonder how
that method, and others in the math.h library, are implemented.




这完全取决于所使用的C编译器并且没有标准化。

如果他们符合ISO C标准中的规范,那么对于所有C关心来说,他们可能是由运营商实施的b $ b。
< br $> b $ b -

/ - Joona Palaste(pa*****@cc.helsinki.fi)-------------芬兰-------- \

\-- http://www.helsinki.fi/~palaste ---------------------规则! -------- /

我在撒谎。

- Anon



This depends completely on the C compiler used and is not standardised.
If they fulfill the specification in the ISO C standard, they might be
implemented by carrier pigeons, for all C cares.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"I am lying."
- Anon




" Dave Rudolf" < NU **************** @ hotmail.com>在消息中写道

新闻:10 ************* @ corp.supernews.com ...

"Dave Rudolf" <nu****************@hotmail.com> wrote in message
news:10*************@corp.supernews.com...
大家好,

通常情况下,我相信ANSI库的编写尽可能高效,


我希望*那个,不一定是但是我有一个应用程序,其中大部分运行时间都在调用acos(...)方法。


我严重怀疑C运行时会调用''acos()'。

也许应用程序本身就是。

所以现在我开始想知道这个方法以及math.h库中的其他方法是如何实现的。
Hi all,

Normally, I would trust that the ANSI libraries are written to be as
efficient as possible,
I would *hope* that, not necessarily "trust".
but I have an application in which the majority of
the run time is calling the acos(...) method.
I seriously doubt that the C runtime calls ''acos()'' at all.
Perhaps the application itself does.
So now I start to wonder how
that method, and others in the math.h library, are implemented.




但是给定的实现者是这样做的。语言标准

仅指定*行为*,而不是实现或性能。

这样的性能也必然取决于底层的

硬件。 />

-Mike



However a given implementor does it. The language standard
only specifies *behavior*, not implementation or performance.
Such performance also necessarily depends upon the underlying
hardware.

-Mike


Dave Rudolf< nu **************** @ hotmail .COM>写道:
Dave Rudolf <nu****************@hotmail.com> wrote:
通常,我相信ANSI库的编写尽可能高效,但我有一个应用程序,其中大部分运行时间是调用acos(...)方法。所以现在我开始想知道该方法和math.h库中的其他方法是如何实现的。
Normally, I would trust that the ANSI libraries are written to be as
efficient as possible, but I have an application in which the majority of
the run time is calling the acos(...) method. So now I start to wonder how
that method, and others in the math.h library, are implemented.




ANSI中没有任何内容标准,需要一定的实施,所以acos()可能会慢,因为糖蜜没有

任何违反标准的行为。从这一点开始,

你的问题在这个小组中无法回答,因为它是

不是关于标准C的问题,而是关于标准C的质量
你正在使用的
实现。因此,您最好的选择是在

a组中询问专用于您的编译器/链接器/标准库

组合,或者,如果它是商业产品,则该公司

写下它们。


< OT>

我想在有浮点单元的机器上这样做

它将被acos()库函数使用,所以在这个

的情况下你可能不会用一些花哨的优惠来获得更快的优惠。

< / OT>

问候,Jens

-

\ Jens Thoms Toerring ___ 济*********** @ physik.fu-berlin.de

\ __________________________ http://www.toerring.de


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

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