ShuXueZhenMiHu 发表于 2020-10-4 20:37:07

有几个关于tlb版的问题问题一下

HugeCalcU4VB 与 HugeCalc4VB 我该用哪一个? 是由电脑配置决定的吗?

ShuXueZhenMiHu 发表于 2020-10-4 20:43:36

使用HugeCalc计算库手动求阶乘的代码可以这样写吗?
Private Sub cmdFactoriel_Click()
    Dim hi1 As Long
    Dim hi2 As Long
    Dim hi3 As Long
    Dim i As Long
   
    Dim pStr As Long
    Dim nStrLen As Long
   
    Dim Str As String
   
    Dim TempsUtilise As Single
   
    QueryPerformanceCounter Counter0
   
    hi1 = HI_new
    hi2 = HI_new
    hi3 = HI_new
      
    QueryPerformanceCounter Counter1
   
    HI_set_u32 hi1, 1
    For i = 2 To CLng(txtNaturel.Text)
   
      HI_mul_u32 hi1, hi1, i
   
    Next i
   
    QueryPerformanceCounter Counter2
   
    TempsUtilise = (Counter2 - Counter1) / Frequency
    txtTempsUtilise.Text = TempsUtilise
   
   
    pStr = HI_getStr(hi1, 0, nStrLen)
   
    L_SetWindowText txtFactoriel1.hWnd, pStr
   
    HI_delete hi1
    HI_delete hi2
    HI_delete hi3
   
    QueryPerformanceCounter Counter3
   
    TempsUtilise = (Counter3 - Counter0) / Frequency
    txtTempsUtilise2.Text = TempsUtilise
   
    ShowErrorCode
End Sub

特别是
    HI_mul_u32 hi1, hi1, i
语句会不会影响运算速度,前一个hi1有没有被删除?

ShuXueZhenMiHu 发表于 2020-10-6 06:32:35

我在Windows10下用VB6,是不是我应该用HugeCalcU4VB版?还有帮我看看我的代码有没有问题,好吗.
页: [1]
查看完整版本: 有几个关于tlb版的问题问题一下