本文整理匯總了VB.NET中System.Numerics.Complex.Addition操作符的典型用法代碼示例。如果您正苦於以下問題:VB.NET Complex.Addition操作符的具體用法?VB.NET Complex.Addition怎麽用?VB.NET Complex.Addition使用的例子?那麽, 這裏精選的操作符代碼示例或許可以為您提供幫助。您也可以進一步了解該操作符所在類System.Numerics.Complex
的用法示例。
在下文中一共展示了Complex.Addition操作符的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Main
' 導入命名空間
Imports System.Numerics
Module modMain
Public Sub Main()
Dim values() As Complex = { New Complex(12.3, -1.4),
New Complex(-6.2, 3.1),
New Complex(8.9, 1.5) }
For Each c1 In values
For Each c2 In values
Console.WriteLine("{0} + {1} = {2}", c1, c2, c1 + c2)
Next
Next
End Sub
End Module
輸出:
(12.3, -1.4) + (12.3, -1.4) = (24.6, -2.8) (12.3, -1.4) + (-6.2, 3.1) = (6.1, 1.7) (12.3, -1.4) + (8.9, 1.5) = (21.2, 0.1) (-6.2, 3.1) + (12.3, -1.4) = (6.1, 1.7) (-6.2, 3.1) + (-6.2, 3.1) = (-12.4, 6.2) (-6.2, 3.1) + (8.9, 1.5) = (2.7, 4.6) (8.9, 1.5) + (12.3, -1.4) = (21.2, 0.1) (8.9, 1.5) + (-6.2, 3.1) = (2.7, 4.6) (8.9, 1.5) + (8.9, 1.5) = (17.8, 3)
示例2: Complex
Dim c1 As New Complex(1.2, 2.3)
Dim c2 As New Complex(2.1, 3.2)
Dim c3 As Complex = c1 + c2