开发者

Using pragma intrinsic(sqrt, pow) in C#?

C++ Summary

Using the #prag开发者_StackOverflow社区ma intrinsic command in the preprocessor section of your code will greatly increase the speed of most math function calls.

#pragma intrinsic(sqrt, pow)

The above code allows most math functions calls to be sent directly to the math co-processor rather than being sent to the function stack.

Question

Is there any way to do this in C#? Other than rewriting the built in functions to do something similar. Like for example, it is common to do power of two, so this would be appropriate, but it is not what I am looking for:

public double Pow2(double value)
{
    return (value * value);
}


C# shouldn't need "#pragma intrinsic", because:

Accessing math coprocessor from C#

The JIT compiler knows about the math coprocessor and will use it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜