Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function HaltonBaseb(b As Long, N As Long) As Double
- ' b - base, N - number of iteration
- Dim h As Double, ib As Double
- Dim i As Long, n0 As Long, n1 As Long
- n0 = N
- h = 0
- ib = 1 / b
- Do While n0 > 0
- n1 = Int(n0 / b)
- i = n0 - n1 * b
- h = h + ib * i
- ib = ib / b
- n0 = n1
- Loop
- HaltonBaseb = h
- End Function
Add Comment
Please, Sign In to add comment