FLOAT2DWORD

 
語法

        Result = FLOAT2DWORD(Argument)

 

操作

        將浮點數轉換為DWord

  • Argument FLOAT2DWORD函數的浮點運算元。
  • Result用來接收FLOAT2DWORD函數結果的位元組變數。

 

說明

        FLOAT2DWORD指令將浮點數轉換為DWord。小數的部分會被四捨五入。如果值超過DWord值的範圍,則會使用數值04294967295

 

範例

 

Sub Main()
   
Dim MyFloat As Float
   
Dim MyDword As Dword   

    MyFloat =
2.4
    MyDword =
FLOAT2DWORD(MyFloat)      ' the result is 2
    Debug "FLOAT2DWORD of 2.4 : ", MyDword, CR
    MyFloat =
2.5
    MyDword =
FLOAT2DWORD(MyFloat)      ' the result is 3
    Debug "FLOAT2DWORD of 2.5 : ", MyDword, CR
    MyFloat = -
1.0
    MyDword =
FLOAT2DWORD(MyFloat)      ' the result is 0
    Debug "FLOAT2DWORD of -1.0 : ", MyDword, CR   
    MyFloat = 4.3E9
    MyDword =
FLOAT2DWORD(MyFloat)      ' the result is 4294967295
    Debug "FLOAT2DWORD of 4.3E9 : ", MyDword, CR
End Sub