C#中的内部方法System.Double.IsNegative()有什么用?

时间:2019-07-05 06:43:32

标签: c# double standard-library

浏览System.Double的源代码时,我遇到了这种方法:

[SecuritySafeCritical]
internal static unsafe bool IsNegative(double d)
{
  return (*(long*) &d & long.MinValue) == long.MinValue;
}

System.Double结构中的任何地方似乎都没有使用它。在其他地方使用了吗?

由于我的计算机上没有C#标准库的完整源代码,因此我不能简单地通过Visual Studio浏览对其的引用。我还发现了this API documentation for it,但没有说明为什么要使用它。

0 个答案:

没有答案