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