问题出在int上,将它去掉就可以了。
不过不知道原理是什么,呵呵

解决方案 »

  1.   

    只有一个原因,Log(10) / Log(10)返回结果不同,用MsgBox时返回1,而用intHeadBits = Int(Log(10) / Log(10))时返回0.999999999999999999...
    放大一下就知道了。
    Dim intHeadBits As Long MsgBox Int(Log(10) / Log(10)*10000) intHeadBits = Int(Log(10) / Log(10)*10000) 
    MsgBox intHeadBits 
    第一个msgbox是10000
    第二个是9999
      

  2.   

    Both Int and Fix remove the fractional part of number and return the resulting integer value.The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.Fix(number) is equivalent to:Sgn(number) * Int(Abs(number))
      

  3.   

    其实VB在这方面是很不成功的,例如
    int(350*0.7)=244就是这个原因。