title: % operator giving strange result in swift ios
body: <p>I am familiar with Mathematics and what the % operator (modulo) gives us for certain values.  However, I am following along a Swift code lecture, and the instructor wants to return a value somewhere between 0 and half of the height of the view.  He sets up the equation as:</p>
  
  <p>var offSet = arc4random() % UInt32(self.frame.size.height / 2)</p>
  
  <p>I must be missing something.  Wouldn't arc give a number between 0 and 1, and then performing % on the height (roughly 700 pixels) would always give 0.  Yet each time the code is run it offsets a random amount somewhere between 0 and half the height of the screen.  If I change % to * the program crashes.</p>
  
  <p>Ideas?</p>