В мануале сказано следующее:
Code
Dim Dwd as Dword
Dim Flt as Float
Symbol PI = 3.14
Flt = 10
Dwd = Flt + PI ' Float calculation will result 13.14,reduced to integer 13
Print Dec Dwd ' Display the integer result 13
Stop
То есть при записи переменной FLOAT в переменную DWORD, в него будет записано целое без долей число. И еще вот:
Floating Point Rounding
Assigning a floating point variable to an integer type will be rounded to the nearest value by default. For
example:
FloatVar = 3.9
DwordVar = FloatVar
The variable DwordVar will hold the value of 4.
This behaviour can be altered by issuing the Float_Rounding = Off declare before the conversion takes
place. For example:
Declare Float_Rounding = Off ' Disable Floating Point Rounding
FloatVar = 3.9 ' Load FloatVar with the value of 3.9
DwordVar = FloatVar ' Truncate 3.9 into FloatVar
The variable DwordVar will hold the value of 3. i.e truncated
The Float_Rounding setting will be remembered, as none of the compiler’s floating point library routines
alter it. However, remember that Floating Point rounding will effect Addition, Subtraction, Division, and
Multiplication accuracy. It is therefore recommended to re-enable rounding after it has been disabled.
Declare Float_Rounding = Off ' Disable Floating Point Rounding
FloatVar = 3.9 ' Load FloatVar with the value of 3.9
DwordVar = FloatVar ' Truncate 3.9 into FloatVar
Declare Float_Rounding = On ' Enable Floating Point Rounding
Note that the Float_Rounding declare will not effect loading a floating point constant value into an integer.
This will always be truncated. For example:
WordVar = 3.9
The variable WordVar will contain the value 3.