本文整理汇总了C#中System.Numerics.Complex.NaturalLogarithm方法的典型用法代码示例。如果您正苦于以下问题:C# Complex.NaturalLogarithm方法的具体用法?C# Complex.NaturalLogarithm怎么用?C# Complex.NaturalLogarithm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Numerics.Complex
的用法示例。
在下文中一共展示了Complex.NaturalLogarithm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanComputeNaturalLogarithm
public void CanComputeNaturalLogarithm([Values(0.0, 0.0, -1.0, -111.1, 111.1)] double real, [Values(0.0, 1.0, 1.0, 111.1, -111.1)] double imag, [Values(double.NegativeInfinity, 0.0, 0.34657359027997264, 5.0570042869255571, 5.0570042869255571)] double expectedReal, [Values(0.0, 1.5707963267948966, 2.3561944901923448, 2.3561944901923448, -0.78539816339744828)] double expectedImag)
{
var value = new Complex(real, imag);
var expected = new Complex(expectedReal, expectedImag);
AssertHelpers.AlmostEqual(expected, value.NaturalLogarithm(), 15);
}
示例2: CanComputeNaturalLogarithm
public void CanComputeNaturalLogarithm(double real, double imag, double expectedReal, double expectedImag)
{
var value = new Complex(real, imag);
var expected = new Complex(expectedReal, expectedImag);
AssertHelpers.AlmostEqual(expected, value.NaturalLogarithm(), 15);
}