double类型,求double类型的费吗数字?

生活知识 2023-03-14 08:43www.tongjingw.cn生活知识

Private Function IsPrime(ByVal n As Double) As Boolean

Dim pb As Double

pb = n – 1

IsPrime = True

For i = 2 To pb

If n Mod i = 0 Then

IsPrime = False

Exit For

End If

Next i

End Function

Private Sub Command1_Click()

For i = 1 To 17

If IsPrime(2 ^ i + 1) = True Then Print 2 ^ i + 1

Next i

End Sub

Private Function Is2n(ByVal n As Double) As Boolean

Is2n = False

If n = 1 Then

Is2n = True

Exit Function

End If

Dim pb As Double

pb = n / 2

Do While pb >= 2

pb = pb / 2

Loop

If pb = 1 Then

Is2n = True

Else

Is2n = False

End If

End Function

Copyright 2016-2025 www.tongjingw.cn 痛经网 版权所有 Power by

缓解痛经,月经周期,痛经药,月经不调,痛经怎么办,大姨妈,治疗痛经,女人痛经,月经推迟