首页 > 解决方案 > vb.net 中是否有替代的“电源”功能

问题描述

Imports System.Numerics
Module Module1
    Sub Main()
        Dim term As BigInteger
        Const Phi As Double = (1 + (5 ^ 0.5)) / 2
        Const phi_ As Double = (1 - (5 ^ 0.5)) / 2

        For count As BigInteger = 2 To 99999999
            term = ((Phi ^ count) - (phi_ ^ count)) / (5 ^ 0.5)
        Next
    End Sub
End Module

标签: vb.net

解决方案


导入System命名空间和使用Math.Pow(double x, double y)函数。此处的详细信息: https ://docs.microsoft.com/en-us/dotnet/api/system.math.pow?view=netframework-4.8


推荐阅读