title: Separate an integer into two (nearly) equal parts
body: <p>I need to separate an integer into two numbers. Something like dividing by two but I only want integer components as a result, such as:</p>
  
  <pre><code>6 = 3 and 3
  7 = 4 and 3
  </code></pre>
  
  <p>I tried the following, but I'm not sure its the best solution. </p>
  
  <pre><code>var number = 7;
  var part1 = 0;
  var part2 = 0;
  
  if((number % 2) == 0) {
      part1 = number / 2;
      part2 = number / 2;
  }
  else {
      part1 = parseInt((number / 2) + 1);
      part2 = parseInt(number / 2);
  }
  </code></pre>
  
  <p>This does what I want, but I don't think this code is clean. </p>
  
  <p>Are there better ways of doing this?</p>