Advertisement
hectic101

Limits (While Loop)

Apr 12th, 2015
1,410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function power2(limit As Integer) As Long
  2.    
  3.     Dim counter As Long
  4.  
  5.     counter = 0
  6.  
  7.     While 2^counter < limit
  8.         counter = counter +1
  9.     Wend
  10.  
  11.     power2 = 2^ (counter - 1)
  12.  
  13. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement