本文介绍了如何查看Microsoft.Visualbasic.Financial.IRR的源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想查看 Microsoft.Visualbasic.Financial.IRR
的源代码。
我该如何将其反编译以查看金融类?
How can I decompile it to see the source code of the IRR method of financial class?
System{" df -k | awk '{sum += $4 }i; END {print sum} '"};
我尝试使用其他软件查看它,但它对我不起作用。有任何软件可以查看源代码吗?
I've tried to view it using different software but it will not work for me. Is there any software that will view the source code?
推荐答案
我已经使用过(它是)以反编译类型 Microsoft.Visualbasic.Financial.IRR
及其方法:
I've used ILSpy(it's free) to decompile the type Microsoft.Visualbasic.Financial.IRR
and it's method IRR:
' Microsoft.VisualBasic.Financial
Public Shared Function IRR(ByRef ValueArray As Double(), Optional Guess As Double=0.1) As Double
Dim upperBound As Integer
Try
upperBound = ValueArray.GetUpperBound(0)
Catch ex As StackOverflowException
Throw ex
Catch ex2 As OutOfMemoryException
Throw ex2
Catch ex3 As ThreadAbortException
Throw ex3
Catch ex_1B As Exception
Throw New ArgumentException(Utils.GetResourceString("Argument_InvalidValue1", New String()() = { "ValueArray" }))
End Try
' The following expression was wrapped in a checked-expression
Dim num As Integer = upperBound + 1
If Guess <= -1.0 Then
Throw New ArgumentException(Utils.GetResourceString("Argument_InvalidValue1", New String()() = { "Guess" }))
End If
If num <= 1 Then
Throw New ArgumentException(Utils.GetResourceString("Argument_InvalidValue1", New String()() = { "ValueArray" }))
End If
Dim num2 As Double
If ValueArray(0) > 0.0 Then
num2 = ValueArray(0)
Else
num2 = -ValueArray(0)
End If
Dim arg_BF_0 As Integer = 0
Dim num3 As Integer = upperBound
Dim i As Integer
' The following expression was wrapped in a checked-expression
i = arg_BF_0
While i <= num3
If ValueArray(i) > num2 Then
num2 = ValueArray(i)
Else
If-ValueArray(i) > num2 Then
num2 = -ValueArray(i)
End If
End If
i = i + 1
End While
Dim num4 As Double = num2 * 1E-07 * 0.01
Dim num5 As Double = Guess
Dim num6 As Double = Financial.OptPV2(ValueArray, num5)
Dim num7 As Double
If num6 > 0.0 Then
num7 = num5 + 1E-05
Else
num7 = num5 - 1E-05
End If
If num7 <= -1.0 Then
Throw New ArgumentException(Utils.GetResourceString("Argument_InvalidValue1", New String()() = { "Rate" }))
End If
Dim num8 As Double = Financial.OptPV2(ValueArray, num7)
i = 0
While True
If num8 = num6 Then
If num7 > num5 Then
num5 -= 1E-05
Else
num5 += 1E-05
End If
num6 = Financial.OptPV2(ValueArray, num5)
If num8 = num6 Then
Exit While
End If
End If
num5 = num7 - num7 - num5 * num8 / num8 - num6
If num5 <= -1.0 Then
num5 = num7 - 1.0 * 0.5
End If
num6 = Financial.OptPV2(ValueArray, num5)
If num5 > num7 Then
num2 = num5 - num7
Else
num2 = num7 - num5
End If
Dim num9 As Double
If num6 > 0.0 Then
num9 = num6
Else
num9 = -num6
End If
If num9 < num4 AndAlso num2 < 1E-07 Then
Return num5
End If
num2 = num6
num6 = num8
num8 = num2
num2 = num5
num5 = num7
num7 = num2
' The following expression was wrapped in a checked-statement
i += 1
If i > 39 Then
GoTo Block_17
End If
End While
Throw New ArgumentException(Utils.GetResourceString("Argument_InvalidValue"))
Block_17:
Throw New ArgumentException(Utils.GetResourceString("Argument_InvalidValue"))
End Function
这篇关于如何查看Microsoft.Visualbasic.Financial.IRR的源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!