Sub bla()
Dim a As Double
a = 1.2 * 10
Debug.Print Int(a)
End Sub
this returns 12 and thats right
Sub bli()
Debug.Print Int(1.2 * 10)
End Sub
this returns 11! Why?
It's the same in Access VBA and Word VBA.
Thank you for any information!
I confirmed the problem Under XL 97 SR-1. Since 1.2 * 10 is "a Double or
any valid numeric expression" (copied from Help), this appears to be a bug.
FWIW: Int(CDbl(1.2 * 10)) does return 12.
Denny Campbell
Grand Rapids, MI USA
Bernhard Just wrote in message <79pdhk$3tg$1...@mosquito.HL.Siemens.DE>...
Sub eight2ten()
For n = 8 To 10 Step 0.1
Debug.Print n
Next n
End Sub
returns
8
8,1
8,2
8,3
8,4
8,5
8,6
8,7
8,8
8,9
9
9,1
9,2
9,3
9,4
9,49999999999999
9,59999999999999
9,69999999999999
9,79999999999999
9,89999999999999
9,99999999999999
Isn't it funny?
Bernhard
Denny Campbell schrieb in Nachricht